Просмотр исходного кода

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 год назад
Родитель
Сommit
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()
                     if self._api_working_protocol_failures == 1:
                         _LOGGER.error(error_message)
+                    else
+                        _LOGGER.debug(error_message)
 
                 if not self._api_protocol_working:
                     await self._rotate_api_protocol_version()