From a28ef6c70342ac02ee087321f4f2ac5150e94185 Mon Sep 17 00:00:00 2001 From: and7ey Date: Fri, 24 May 2024 15:49:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D0=BB=D0=BE=D0=B3=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - убраны warning и error в логах, где они не нужны - добавлено больше логов для новых устройств --- api.py | 6 +++++- climate.py | 2 +- manifest.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/api.py b/api.py index 1ffcb5a..ec5c865 100644 --- a/api.py +++ b/api.py @@ -115,6 +115,7 @@ def pull_data(self): and "application/json" in resp.headers.get("content-type") and resp.json().get("data", {}).get("presentation", {}).get("layout", {}).get('scrollContainer', []) ): + _LOGGER.debug(resp.text) containers = resp.json().get("data", {}).get("presentation", {}).get("layout", {}).get('scrollContainer', []) for item in containers: if item.get("contractName", "") == "deviceList": @@ -179,7 +180,7 @@ def __init__(self, device_mac: str, device_serial: str, device_title: str, haier status_url = API_STATUS.replace("{mac}", self._id) - _LOGGER.debug(f"Getting initial status of device {self._id}, url: {status_url}") + _LOGGER.info(f"Getting initial status of device {self._id}, url: {status_url}") resp = requests.get( status_url, headers={"X-Auth-token": self._haier._token} @@ -189,6 +190,7 @@ def __init__(self, device_mac: str, device_serial: str, device_title: str, haier and resp.json().get("attributes", {}) ): _LOGGER.debug(f"Update device {self._id} status code: {resp.status_code}") + _LOGGER.debug(resp.text) attributes = resp.json().get("attributes", {}) for attr in attributes: if attr.get('name', '') == "0": # Температура в комнате @@ -250,6 +252,8 @@ def _on_message(self, ws: websocket.WebSocket, message: str) -> None: self._handle_status_update(message_dict) elif message_type == "command_response": pass + elif message_type == "info": + pass else: _LOGGER.debug(f"Got unknown message of type: {message_type}") diff --git a/climate.py b/climate.py index 1c29d51..bdb1344 100644 --- a/climate.py +++ b/climate.py @@ -89,7 +89,7 @@ def hvac_mode(self) -> str: def set_hvac_mode(self, hvac_mode: str) -> None: """Set new target hvac mode.""" - _LOGGER.warning(f"set_hvac_mode {hvac_mode}") + _LOGGER.debug(f"set_hvac_mode {hvac_mode}") if hvac_mode == HVACMode.OFF: self._module.switchOff() else: diff --git a/manifest.json b/manifest.json index 1f1568d..261585b 100644 --- a/manifest.json +++ b/manifest.json @@ -9,6 +9,6 @@ "iot_class": "cloud_polling", "issue_tracker": "https://github.com/and7ey/haier_evo/issues", "requirements": ["requests"], - "version": "0.1.1", + "version": "0.1.2", "zeroconf": [] } \ No newline at end of file