diff --git a/app/wyzebridge/wyze_api.py b/app/wyzebridge/wyze_api.py index 77213545..a429b8cc 100644 --- a/app/wyzebridge/wyze_api.py +++ b/app/wyzebridge/wyze_api.py @@ -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: @@ -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} diff --git a/app/wyzebridge/wyze_stream.py b/app/wyzebridge/wyze_stream.py index 2fcc6b1c..a1e6d20e 100644 --- a/app/wyzebridge/wyze_stream.py +++ b/app/wyzebridge/wyze_stream.py @@ -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")