Skip to content

Commit

Permalink
Fix quick_reply_dict when no replays available
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG committed Nov 5, 2024
1 parent 7832482 commit 2af4154
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions reolink_aio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,10 +1056,13 @@ def hub_visitor_tone_id(self, channel: int) -> int:
return self._hub_audio_settings[channel]["AudioCfg"]["ringToneId"]

def quick_reply_dict(self, channel: int) -> dict[int, str]:
audio_dict = {-1: "off"}
if channel not in self._audio_file_list:
return {-1: "off"}
return audio_dict

if self._audio_file_list[channel]["AudioFileList"] is None:
return audio_dict

audio_dict = {-1: "off"}
for audio_file in self._audio_file_list[channel]["AudioFileList"]:
audio_dict[audio_file["id"]] = audio_file["fileName"]
return audio_dict
Expand Down

0 comments on commit 2af4154

Please sign in to comment.