diff --git a/homeassistant/components/roomba/irobot_base.py b/homeassistant/components/roomba/irobot_base.py index 524b5a915f9..f510f4965b0 100644 --- a/homeassistant/components/roomba/irobot_base.py +++ b/homeassistant/components/roomba/irobot_base.py @@ -31,6 +31,7 @@ _LOGGER = logging.getLogger(__name__) ATTR_CLEANING_TIME = "cleaning_time" ATTR_CLEANED_AREA = "cleaned_area" ATTR_ERROR = "error" +ATTR_ERROR_CODE = "error_code" ATTR_POSITION = "position" ATTR_SOFTWARE_VERSION = "software_version" @@ -174,11 +175,6 @@ class IRobotVacuum(IRobotEntity, StateVacuumEntity): # Roomba software version software_version = state.get("softwareVer") - # Error message in plain english - error_msg = "None" - if hasattr(self.vacuum, "error_message"): - error_msg = self.vacuum.error_message - # Set properties that are to appear in the GUI state_attrs = {ATTR_SOFTWARE_VERSION: software_version} @@ -198,9 +194,10 @@ class IRobotVacuum(IRobotEntity, StateVacuumEntity): state_attrs[ATTR_CLEANING_TIME] = cleaning_time state_attrs[ATTR_CLEANED_AREA] = cleaned_area - # Skip error attr if there is none - if error_msg and error_msg != "None": - state_attrs[ATTR_ERROR] = error_msg + # Error + if self.vacuum.error_code != 0: + state_attrs[ATTR_ERROR] = self.vacuum.error_message + state_attrs[ATTR_ERROR_CODE] = self.vacuum.error_code # Not all Roombas expose position data # https://github.com/koalazak/dorita980/issues/48 diff --git a/homeassistant/components/roomba/manifest.json b/homeassistant/components/roomba/manifest.json index 45fe9133bca..3d710467b58 100644 --- a/homeassistant/components/roomba/manifest.json +++ b/homeassistant/components/roomba/manifest.json @@ -3,7 +3,7 @@ "name": "iRobot Roomba", "config_flow": true, "documentation": "https://www.home-assistant.io/integrations/roomba", - "requirements": ["roombapy==1.5.3"], + "requirements": ["roombapy==1.6.1"], "dependencies": [], "codeowners": ["@pschmitt", "@cyr-ius", "@shenxn"] } diff --git a/requirements_all.txt b/requirements_all.txt index f0351969a1b..17d1ab65373 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1871,7 +1871,7 @@ rocketchat-API==0.6.1 rokuecp==0.4.0 # homeassistant.components.roomba -roombapy==1.5.3 +roombapy==1.6.1 # homeassistant.components.rova rova==0.1.0 diff --git a/requirements_test_all.txt b/requirements_test_all.txt index 8fdd41e2f68..cdff16b7494 100644 --- a/requirements_test_all.txt +++ b/requirements_test_all.txt @@ -765,7 +765,7 @@ ring_doorbell==0.6.0 rokuecp==0.4.0 # homeassistant.components.roomba -roombapy==1.5.3 +roombapy==1.6.1 # homeassistant.components.yamaha rxv==0.6.0