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

vacuum: Treat null error the same as 0.

Issue #584
Jason Rumney 2 лет назад
Родитель
Сommit
c6fac62cfd
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      custom_components/tuya_local/vacuum.py

+ 1 - 1
custom_components/tuya_local/vacuum.py

@@ -105,7 +105,7 @@ class TuyaLocalVacuum(TuyaLocalEntity, StateVacuumEntity):
     def state(self):
         """Return the state of the vacuum cleaner."""
         status = self.status
-        if self._error_dps and self._error_dps.get_value(self._device) != 0:
+        if self._error_dps and self._error_dps.get_value(self._device):
             return STATE_ERROR
         elif status in [SERVICE_RETURN_TO_BASE, "returning"]:
             return STATE_RETURNING