From b04ad65dc21d4a2305d2c7972b6467fc3a002477 Mon Sep 17 00:00:00 2001 From: Dan Wheaton Date: Wed, 24 Jan 2024 00:02:04 +1100 Subject: [PATCH] fix logic as to when to reset --- custom_components/linktap/sensor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/linktap/sensor.py b/custom_components/linktap/sensor.py index b255964..806ba8e 100644 --- a/custom_components/linktap/sensor.py +++ b/custom_components/linktap/sensor.py @@ -109,7 +109,7 @@ def state(self): self._state = self.translate_plan_mode(attributes["plan_mode"]) else: self._state = attributes[self.attribute] - if self.attribute == "volume": + if self.attribute == "volume" and self._state == 0: self.last_reset = dt_util.utcnow() return self._state