Skip to content

Commit

Permalink
Fix smart detection push
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG committed Mar 8, 2025
1 parent c00b4ec commit 90befc6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions reolink_aio/baichuan/baichuan.py
Original file line number Diff line number Diff line change
Expand Up @@ -548,13 +548,13 @@ def _parse_xml(self, cmd_id: int, xml: str) -> None:
if smart_type is None:
continue
sub_list = smart_ai.findall("subList")
index_bit_ob = smart_list.find("index")
index_bit_ob = smart_ai.find("index")
if index_bit_ob is not None and index_bit_ob.text is not None:
# The index is based on bits, bit 0 = loc 0, bit 1 = loc 1, index 7 = loc 1, 2 and 3.
index_bit = int(index_bit_ob.text)
loop_bit = 1
while index_bit >= loop_bit:
location = loop_bit.bit_length()
location = loop_bit.bit_length() - 1
detected = index_bit & loop_bit > 0
self._ai_detect[channel][smart_type][location]["state"] = detected
if sub_list is None and detected:
Expand Down

0 comments on commit 90befc6

Please sign in to comment.