From 7f5cc8c30ff4485b5ea4da0ec7769603922da184 Mon Sep 17 00:00:00 2001 From: Luke Bonaccorsi Date: Thu, 7 Sep 2023 17:14:49 +0100 Subject: [PATCH] Log debug message when state changes to error --- custom_components/robovac/vacuum.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/custom_components/robovac/vacuum.py b/custom_components/robovac/vacuum.py index d50df9e..d4b72ee 100644 --- a/custom_components/robovac/vacuum.py +++ b/custom_components/robovac/vacuum.py @@ -191,10 +191,11 @@ class RoboVacEntity(StateVacuumEntity): def state(self) -> str | None: if self.tuya_state is None: return STATE_UNAVAILABLE - elif type(self.error_code) is not None and self.error_code not in [ + elif type(self.error_code) is not None and self.error_code and self.error_code not in [ 0, "no_error", ]: + _LOGGER.debug("State changed to error. Error message: {}".format(getErrorMessage(self.error_code))) return STATE_ERROR elif self.tuya_state == "Charging" or self.tuya_state == "completed": return STATE_DOCKED