Skip to content

Commit

Permalink
Fix: Siren Type not working on really old cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
JurajNyiri committed Nov 28, 2024
1 parent 7262383 commit 972a783
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions custom_components/tapo_control/select.py
Original file line number Diff line number Diff line change
Expand Up @@ -1119,11 +1119,12 @@ def updateTapo(self, camData):
else:
self._attr_options = camData["alarm_siren_type_list"]
self.user_sounds = {}
for user_sound in camData["alarm_user_sounds"]:
if "name" in user_sound:
self._attr_options.append(user_sound["name"])
if "id" in user_sound:
self.user_sounds[user_sound["id"]] = user_sound["name"]
if camData["alarm_user_sounds"] is not None:
for user_sound in camData["alarm_user_sounds"]:
if "name" in user_sound:
self._attr_options.append(user_sound["name"])
if "id" in user_sound:
self.user_sounds[user_sound["id"]] = user_sound["name"]

self.alarm_enabled = camData["alarm_config"]["automatic"] == "on"
self.alarm_mode = camData["alarm_config"]["mode"]
Expand Down

0 comments on commit 972a783

Please sign in to comment.