Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
AI state
Browse files Browse the repository at this point in the history
  • Loading branch information
fwestenberg committed May 26, 2021
1 parent b80e8c7 commit 99a1797
Showing 1 changed file with 1 addition and 19 deletions.
20 changes: 1 addition & 19 deletions reolink/camera_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ def __init__(
self._lease_time = None
self._motion_state = False
self._ai_state = None
self._people_state = None
self._vehicle_state = None
self._device_info = None
self._hdd_info = None
self._ftp_state = None
Expand Down Expand Up @@ -151,16 +149,6 @@ def ai_state(self):
"""Return the AI state."""
return self._ai_state

@property
def people_state(self):
"""Return the people state."""
return self._people_state

@property
def vehicle_state(self):
"""Return the vehicle state."""
return self._vehicle_state

@property
def ftp_state(self):
"""Return the FTP state."""
Expand Down Expand Up @@ -417,16 +405,12 @@ async def get_ai_state(self):
if json_data is None:
_LOGGER.error(
"Unable to get AI detection state at IP %s", self._host
)
self._people_state = False
self._vehicle_state = False
)
return self._ai_state

await self.map_json_response(json_data)
except (TypeError, json.JSONDecodeError):
await self.clear_token()
self._people_state = False
self._vehicle_state = False

return self._ai_state

Expand Down Expand Up @@ -484,8 +468,6 @@ async def map_json_response(self, json_data): # pylint: disable=too-many-branch

elif data["cmd"] == "GetAiState":
self._ai_state = json_data[0]["value"]
self._people_state = json_data[0]["value"]["people_state"] == 1
self._vehicle_state = json_data[0]["value"]["vehicle_state"] == 1

elif data["cmd"] == "GetDevInfo":
self._device_info = data
Expand Down

0 comments on commit 99a1797

Please sign in to comment.