Skip to content

Commit

Permalink
Add smart_ai_index
Browse files Browse the repository at this point in the history
  • Loading branch information
starkillerOG committed Mar 8, 2025
1 parent 90befc6 commit 56c54ec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions reolink_aio/baichuan/baichuan.py
Original file line number Diff line number Diff line change
Expand Up @@ -1250,13 +1250,16 @@ def smart_type_list(self, channel: int) -> list[str]:
def smart_location_list(self, channel: int, smart_type: str) -> list[int]:
return list(self._ai_detect.get(channel, {}).get(smart_type, {}).keys())

def smart_ai_name(self, channel: int, smart_type: str, location: int) -> str:
return self._ai_detect.get(channel, {}).get(smart_type, {}).get(location, {}).get("name", "Unknown")

def smart_ai_type_list(self, channel: int, smart_type: str, location: int) -> list[str]:
smart_ai = self._ai_detect.get(channel, {}).get(smart_type, {}).get(location, {})
return list(AI_DETECTS.intersection(smart_ai))

def smart_ai_name(self, channel: int, smart_type: str, location: int) -> str:
return self._ai_detect.get(channel, {}).get(smart_type, {}).get(location, {}).get("name", "Unknown")

def smart_ai_index(self, channel: int, smart_type: str, location: int) -> int:
return self._ai_detect.get(channel, {}).get(smart_type, {}).get(location, {}).get("index", 0)

def smart_ai_state(self, channel: int, smart_type: str, location: int, ai_type: str = "state") -> bool:
return self._ai_detect.get(channel, {}).get(smart_type, {}).get(location, {}).get(ai_type, False)

Expand Down

0 comments on commit 56c54ec

Please sign in to comment.