Переглянути джерело

Device: log subsequent failures as debug

Rather than losing the subsequent errors, log them at debug level.
- it may be of interest in some cases how frequently the connection attempts
are failing (eg to investigate whether it is hung on a single connection,
or retrying regularly as designed).
- the error messages later may be different than the initial one when the
connection was dropped.
Jason Rumney 1 рік тому
батько
коміт
2e89b0fe61
1 змінених файлів з 2 додано та 0 видалено
  1. 2 0
      custom_components/tuya_local/device.py

+ 2 - 0
custom_components/tuya_local/device.py

@@ -598,6 +598,8 @@ class TuyaLocalDevice(object):
                             entity.async_schedule_update_ha_state()
                             entity.async_schedule_update_ha_state()
                     if self._api_working_protocol_failures == 1:
                     if self._api_working_protocol_failures == 1:
                         _LOGGER.error(error_message)
                         _LOGGER.error(error_message)
+                    else
+                        _LOGGER.debug(error_message)
 
 
                 if not self._api_protocol_working:
                 if not self._api_protocol_working:
                     await self._rotate_api_protocol_version()
                     await self._rotate_api_protocol_version()