Skip to content

Commit

Permalink
Properly initialize capabilities for older cameras
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG committed Apr 6, 2023
1 parent 6f2bfa4 commit d107624
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions reolink_aio/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,7 @@ async def get_host_data(self) -> None:
for channel in self._channels:
ch_body = [
{"cmd": "GetChnTypeInfo", "action": 0, "param": {"channel": channel}},
{"cmd": "GetMdState", "action": 0, "param": {"channel": channel}},
{"cmd": "GetAiState", "action": 0, "param": {"channel": channel}}, # to capture AI capabilities
{"cmd": "GetEvents", "action": 0, "param": {"channel": channel}},
{"cmd": "GetWhiteLed", "action": 0, "param": {"channel": channel}},
Expand Down Expand Up @@ -1263,6 +1264,17 @@ async def get_host_data(self) -> None:
{"cmd": "GetMdAlarm", "action": 0, "param": {"channel": channel}},
]
)
else:
ch_body.extend(
[
{"cmd": "GetEmail", "action": 0, "param": {"channel": channel}},
{"cmd": "GetPush", "action": 0, "param": {"channel": channel}},
{"cmd": "GetFtp", "action": 0, "param": {"channel": channel}},
{"cmd": "GetRec", "action": 0, "param": {"channel": channel}},
{"cmd": "GetAudioAlarm", "action": 0, "param": {"channel": channel}},
{"cmd": "GetAlarm", "action": 0, "param": {"Alarm": {"channel": channel, "type": "md"}}},
]
)

body.extend(ch_body)
channels.extend([channel] * len(ch_body))
Expand Down

0 comments on commit d107624

Please sign in to comment.