Explorar o código

Move protocol messages to debug, exceptions up to info.

In order to understand what is causing the protocol version to keep switching,
we want to see the exceptions.
Protocol is less interesting now, as it is basically working.
Jason Rumney %!s(int64=5) %!d(string=hai) anos
pai
achega
1d1fb87009
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      custom_components/tuya_local/device.py

+ 3 - 3
custom_components/tuya_local/device.py

@@ -164,7 +164,7 @@ class TuyaLocalDevice(object):
         new_state = self._api.status()
         self._cached_state = new_state["dps"]
         self._cached_state["updated_at"] = time()
-        _LOGGER.info(f"refreshed device state: {json.dumps(new_state)}")
+        _LOGGER.debug(f"refreshed device state: {json.dumps(new_state)}")
         _LOGGER.debug(
             f"new cache state (including pending properties): {json.dumps(self._get_cached_state())}"
         )
@@ -198,7 +198,7 @@ class TuyaLocalDevice(object):
         pending_properties = self._get_pending_properties()
         payload = self._api.generate_payload("set", pending_properties)
 
-        _LOGGER.info(f"sending dps update: {json.dumps(pending_properties)}")
+        _LOGGER.debug(f"sending dps update: {json.dumps(pending_properties)}")
 
         self._retry_on_failed_connection(
             lambda: self._send_payload(payload), "Failed to update device state."
@@ -222,7 +222,7 @@ class TuyaLocalDevice(object):
                 func()
                 break
             except Exception as e:
-                _LOGGER.debug(f"Retrying after exception {e}")
+                _LOGGER.info(f"Retrying after exception {e}")
                 if i + 1 == self._CONNECTION_ATTEMPTS:
                     self._reset_cached_state()
                     _LOGGER.error(error_message)