Skip to content

Commit

Permalink
Merge pull request #636 from marcosngomezi/patch-1
Browse files Browse the repository at this point in the history
Fix/ Duration and volume fix for hubs and c420s
  • Loading branch information
JurajNyiri committed Jul 21, 2024
2 parents b41d6ea + df74c2a commit 1f54c22
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions custom_components/tapo_control/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,9 @@ def updateTapo(self, camData):
self._attr_state = 5
elif str(alarmVolume) == "high":
self._attr_state = 10
self.alarm_enabled = camData["alarm_config"]["automatic"] == "on"
self.alarm_mode = camData["alarm_config"]["mode"]
if self.typeOfAlarm == "getAlarm":
self.alarm_enabled = camData["alarm_config"]["automatic"] == "on"
self.alarm_mode = camData["alarm_config"]["mode"]


class TapoSpotlightIntensity(TapoNumberEntity):
Expand Down Expand Up @@ -471,5 +472,6 @@ def updateTapo(self, camData):
self._attr_state = STATE_UNAVAILABLE
else:
self._attr_state = camData["alarm_config"][self.value_key]
self.alarm_enabled = camData["alarm_config"]["automatic"] == "on"
self.alarm_mode = camData["alarm_config"]["mode"]
if self.typeOfAlarm == "getAlarm":
self.alarm_enabled = camData["alarm_config"]["automatic"] == "on"
self.alarm_mode = camData["alarm_config"]["mode"]

0 comments on commit 1f54c22

Please sign in to comment.