Skip to content

Commit

Permalink
Get device_setting from cloud #1194
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlt8 committed Jul 7, 2024
1 parent 3438b5d commit d197309
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/wyzebridge/wyze_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def run_action(self, cam: WyzeCamera, action: str):
return {"status": "error", "response": str(ex)}

@authenticated
def get_device_info(self, cam: WyzeCamera, pid: str = ""):
def get_device_info(self, cam: WyzeCamera, pid: str = "", cmd: str = ""):
logger.info(f"[CONTROL] ☁️ get_device_Info for {cam.name_uri} via Wyze API")
params = {"device_mac": cam.mac, "device_model": cam.product_model}
try:
Expand All @@ -341,6 +341,9 @@ def get_device_info(self, cam: WyzeCamera, pid: str = ""):
logger.error(f"[CONTROL] ERROR: {ex}")
return {"status": "error", "response": str(ex)}

if cmd in resp:
return {"status": "success", "response": resp[cmd]}

if not pid:
return {"status": "success", "response": property_list}

Expand Down
2 changes: 2 additions & 0 deletions app/wyzebridge/wyze_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,8 @@ def send_cmd(self, cmd: str, payload: str | list | dict = "") -> dict:

if cmd == "device_info":
return self.api.get_device_info(self.camera)
if cmd == "device_setting":
return self.api.get_device_info(self.camera, cmd="device_setting")

if cmd == "battery":
return self.api.get_device_info(self.camera, "P8")
Expand Down

0 comments on commit d197309

Please sign in to comment.