From 73e31baa8d2ec3f5ad383ca0dbf4b8025695765e Mon Sep 17 00:00:00 2001 From: rospogrigio Date: Thu, 22 Oct 2020 12:16:20 +0200 Subject: [PATCH 1/7] First implementation of vacuum platform --- custom_components/localtuya/__init__.py | 5 +++++ custom_components/localtuya/const.py | 5 ++++- custom_components/localtuya/translations/en.json | 2 ++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/custom_components/localtuya/__init__.py b/custom_components/localtuya/__init__.py index f60908d59..b04d8d764 100644 --- a/custom_components/localtuya/__init__.py +++ b/custom_components/localtuya/__init__.py @@ -53,6 +53,11 @@ current: 18 # Optional current_consumption: 19 # Optional voltage: 20 # Optional + + - platform: vacuum + friendly_name: Device Fan + id: 1 + battery_dp: 4 """ import asyncio import logging diff --git a/custom_components/localtuya/const.py b/custom_components/localtuya/const.py index afd6f2315..d941debb1 100644 --- a/custom_components/localtuya/const.py +++ b/custom_components/localtuya/const.py @@ -28,11 +28,14 @@ # sensor CONF_SCALING = "scaling" +# vacuum +CONF_BATTERY_DP = "battery_dp" + DATA_DISCOVERY = "discovery" DOMAIN = "localtuya" # Platforms in this list must support config flows -PLATFORMS = ["binary_sensor", "cover", "fan", "light", "sensor", "switch"] +PLATFORMS = ["binary_sensor", "cover", "fan", "light", "sensor", "switch", "vacuum"] TUYA_DEVICE = "tuya_device" diff --git a/custom_components/localtuya/translations/en.json b/custom_components/localtuya/translations/en.json index 536350f9c..43523e61d 100644 --- a/custom_components/localtuya/translations/en.json +++ b/custom_components/localtuya/translations/en.json @@ -56,6 +56,7 @@ "scaling": "Scaling Factor", "state_on": "On Value", "state_off": "Off Value", + "battery_dp": "Battery status DP", "brightness": "Brightness", "brightness_lower": "Brightness Lower Value", "brightness_upper": "Brightness Upper Value", @@ -96,6 +97,7 @@ "scaling": "Scaling Factor", "state_on": "On Value", "state_off": "Off Value", + "battery_dp": "Battery status DP", "brightness": "Brightness", "brightness_lower": "Brightness Lower Value", "brightness_upper": "Brightness Upper Value", From 11f7e1d5a099af6e33bfcb2236420fe404c513bd Mon Sep 17 00:00:00 2001 From: rospogrigio Date: Thu, 22 Oct 2020 12:17:48 +0200 Subject: [PATCH 2/7] Added missing vacuum.py --- custom_components/localtuya/vacuum.py | 111 ++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 custom_components/localtuya/vacuum.py diff --git a/custom_components/localtuya/vacuum.py b/custom_components/localtuya/vacuum.py new file mode 100644 index 000000000..ee4baebf9 --- /dev/null +++ b/custom_components/localtuya/vacuum.py @@ -0,0 +1,111 @@ +"""Platform to locally control Tuya-based vacuum devices.""" +import logging +from functools import partial + +import voluptuous as vol + +from homeassistant.components.vacuum import ( + VacuumEntity, + DOMAIN, + STATE_CLEANING, + STATE_DOCKED, + STATE_RETURNING, + STATE_ERROR, +) +from homeassistant.const import ( + STATE_IDLE, + STATE_PAUSED, +) + +from .const import ( + CONF_BATTERY_DP, +) +from .common import LocalTuyaEntity, async_setup_entry + +_LOGGER = logging.getLogger(__name__) + + +def flow_schema(dps): + """Return schema used in config flow.""" + return { + vol.Optional(CONF_BATTERY_DP): vol.In(dps), + } + + +class LocaltuyaVacuum(LocalTuyaEntity, VacuumEntity): + """Tuya vacuum device.""" + + def __init__( + self, + device, + config_entry, + switchid, + **kwargs, + ): + """Initialize a new LocaltuyaVacuum.""" + super().__init__(device, config_entry, switchid, **kwargs) + self._state = None + self._battery_level = None + print("Initialized vacuum [{}]".format(self.name)) + + @property + def state(self): + """Return the vacuum state.""" + return STATE_IDLE + + @property + def battery_level(self): + """Return the current battery level.""" + return self._battery_level + + @property + def cleaning_mode(self): + """Return the current cleaning mode.""" + return None + + @property + def cleaning_mode_list(self): + """Return the list of available fan speeds and cleaning modes.""" + return NotImplementedError() + + async def async_turn_on(): + """Turn the vacuum on and start cleaning.""" + return None + + async def async_turn_off(): + """Turn the vacuum off stopping the cleaning and returning home.""" + return None + + async def async_return_to_base(): + """Set the vacuum cleaner to return to the dock.""" + return None + + async def async_stop(): + """Stop the vacuum cleaner, do not return to base.""" + return None + + async def async_clean_spot(): + """Perform a spot clean-up.""" + return None + + async def async_locate(): + """Locate the vacuum cleaner.""" + return None + + async def async_set_cleaning_mode(): + """Set the cleaning mode.""" + return None + + async def async_send_command(): + """Send a command to a vacuum cleaner.""" + return None + + def status_updated(self): + """Device status was updated.""" + self._state = self.dps(self._dps_id) + + if self.has_config(CONF_BATTERY_DP): + self._battery_level = self.dps_conf(CONF_BATTERY_DP) + + +async_setup_entry = partial(async_setup_entry, DOMAIN, LocaltuyaVacuum, flow_schema) From 1a63093e8f2411317b90c1aeeaa598bcd4db7973 Mon Sep 17 00:00:00 2001 From: rospogrigio Date: Fri, 23 Oct 2020 20:49:52 +0200 Subject: [PATCH 3/7] fixed syntax --- custom_components/localtuya/vacuum.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/custom_components/localtuya/vacuum.py b/custom_components/localtuya/vacuum.py index ee4baebf9..0e08dc483 100644 --- a/custom_components/localtuya/vacuum.py +++ b/custom_components/localtuya/vacuum.py @@ -66,46 +66,51 @@ def cleaning_mode(self): @property def cleaning_mode_list(self): """Return the list of available fan speeds and cleaning modes.""" +# return {"smart", "spirale", "random"} return NotImplementedError() - async def async_turn_on(): + async def async_turn_on(self, **kwargs): """Turn the vacuum on and start cleaning.""" return None - async def async_turn_off(): + async def async_turn_off(self, **kwargs): """Turn the vacuum off stopping the cleaning and returning home.""" return None - async def async_return_to_base(): + async def async_return_to_base(self, **kwargs): """Set the vacuum cleaner to return to the dock.""" return None - async def async_stop(): + async def async_stop(self, **kwargs): """Stop the vacuum cleaner, do not return to base.""" return None - async def async_clean_spot(): + async def async_clean_spot(self, **kwargs): """Perform a spot clean-up.""" return None - async def async_locate(): + async def async_locate(self, **kwargs): """Locate the vacuum cleaner.""" return None - async def async_set_cleaning_mode(): + async def async_set_cleaning_mode(self, **kwargs): """Set the cleaning mode.""" + _LOGGER.debug("Setting cleaning mode: %r", kwargs) return None - async def async_send_command(): + async def async_send_command(self, **kwargs): """Send a command to a vacuum cleaner.""" + _LOGGER.debug("Sending command: %r", kwargs) return None def status_updated(self): """Device status was updated.""" + print("STATUS UPDATE") self._state = self.dps(self._dps_id) if self.has_config(CONF_BATTERY_DP): self._battery_level = self.dps_conf(CONF_BATTERY_DP) + print("STATUS UPDATED [{}] [{}]".format(self._state, self._battery_level)) async_setup_entry = partial(async_setup_entry, DOMAIN, LocaltuyaVacuum, flow_schema) From 08b9ef28b58c409d43c91dc3017f26888efa2ba5 Mon Sep 17 00:00:00 2001 From: rospogrigio Date: Fri, 23 Oct 2020 22:39:11 +0200 Subject: [PATCH 4/7] Added supported_features to vacuum --- custom_components/localtuya/vacuum.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/custom_components/localtuya/vacuum.py b/custom_components/localtuya/vacuum.py index ae527961e..597ecea6c 100644 --- a/custom_components/localtuya/vacuum.py +++ b/custom_components/localtuya/vacuum.py @@ -42,6 +42,11 @@ def __init__( self._battery_level = None print("Initialized vacuum [{}]".format(self.name)) + @property + def supported_features(self): + """Flag supported features.""" + return None + @property def state(self): """Return the vacuum state.""" From 7fc27ec07a11679626e5b2e7f21f5b8f9038dfde Mon Sep 17 00:00:00 2001 From: rospogrigio Date: Mon, 26 Oct 2020 13:59:04 +0100 Subject: [PATCH 5/7] Fixed conflicts --- custom_components/localtuya/translations/en.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/custom_components/localtuya/translations/en.json b/custom_components/localtuya/translations/en.json index 1fe0fd181..0e52c4495 100644 --- a/custom_components/localtuya/translations/en.json +++ b/custom_components/localtuya/translations/en.json @@ -57,6 +57,10 @@ "state_on": "On Value", "state_off": "Off Value", "battery_dp": "Battery status DP", + "cleaning_mode_dp": "Cleaning mode DP", + "cleaning_modes": "Cleaning modes list (comma-separated)", + "fan_speed_dp": "Fan speeds DP", + "fan_speeds": "Fan speeds list (comma-separated)", "brightness": "Brightness (only for white color)", "brightness_lower": "Brightness Lower Value", "brightness_upper": "Brightness Upper Value", @@ -100,6 +104,10 @@ "state_on": "On Value", "state_off": "Off Value", "battery_dp": "Battery status DP", + "cleaning_mode_dp": "Cleaning mode DP", + "cleaning_modes": "Cleaning modes list (comma-separated)", + "fan_speed_dp": "Fan speeds DP", + "fan_speeds": "Fan speeds list (comma-separated)", "brightness": "Brightness (only for white color)", "brightness_lower": "Brightness Lower Value", "brightness_upper": "Brightness Upper Value", From 6b03e1a022657eddd62cd8c5ee8cfbcbafe0c9d4 Mon Sep 17 00:00:00 2001 From: rospogrigio Date: Mon, 26 Oct 2020 15:40:02 +0100 Subject: [PATCH 6/7] Continuing vacuum development --- custom_components/localtuya/const.py | 8 ++ custom_components/localtuya/light.py | 2 +- custom_components/localtuya/vacuum.py | 149 ++++++++++++++++++++++---- 3 files changed, 135 insertions(+), 24 deletions(-) diff --git a/custom_components/localtuya/const.py b/custom_components/localtuya/const.py index d67726c03..96403b665 100644 --- a/custom_components/localtuya/const.py +++ b/custom_components/localtuya/const.py @@ -31,7 +31,15 @@ CONF_SCALING = "scaling" # vacuum +CONF_COMMANDS_DP = "commands_dp" +CONF_IDLE_STATUS_VALUE = "idle_status_value" +CONF_RETURNING_STATUS_VALUE = "returning_status_value" +CONF_DOCKED_STATUS_VALUE = "docked_status_value" CONF_BATTERY_DP = "battery_dp" +CONF_CLEANING_MODE_DP = "cleaning_mode_dp" +CONF_CLEANING_MODES = "cleaning_modes" +CONF_FAN_SPEED_DP = "fan_speed_dp" +CONF_FAN_SPEEDS = "fan_speeds" DATA_DISCOVERY = "discovery" diff --git a/custom_components/localtuya/light.py b/custom_components/localtuya/light.py index 67e3adf0b..3598735a0 100644 --- a/custom_components/localtuya/light.py +++ b/custom_components/localtuya/light.py @@ -10,8 +10,8 @@ ATTR_HS_COLOR, DOMAIN, SUPPORT_BRIGHTNESS, - SUPPORT_COLOR_TEMP, SUPPORT_COLOR, + SUPPORT_COLOR_TEMP, LightEntity, ) from homeassistant.const import CONF_BRIGHTNESS, CONF_COLOR_TEMP diff --git a/custom_components/localtuya/vacuum.py b/custom_components/localtuya/vacuum.py index 597ecea6c..646a62a42 100644 --- a/custom_components/localtuya/vacuum.py +++ b/custom_components/localtuya/vacuum.py @@ -7,22 +7,52 @@ DOMAIN, STATE_CLEANING, STATE_DOCKED, - STATE_ERROR, + STATE_IDLE, STATE_RETURNING, + SUPPORT_BATTERY, + SUPPORT_FAN_SPEED, + SUPPORT_PAUSE, + SUPPORT_RETURN_HOME, + SUPPORT_START, + SUPPORT_STATE, + SUPPORT_STATUS, + SUPPORT_STOP, VacuumEntity, ) -from homeassistant.const import STATE_IDLE, STATE_PAUSED from .common import LocalTuyaEntity, async_setup_entry -from .const import CONF_BATTERY_DP +from .const import ( + CONF_BATTERY_DP, + CONF_CLEANING_MODE_DP, + CONF_CLEANING_MODES, + CONF_COMMANDS_DP, + CONF_COMMANDS_SET, + CONF_DOCKED_STATUS_VALUE, + CONF_FAN_SPEED_DP, + CONF_FAN_SPEEDS, + CONF_IDLE_STATUS_VALUE, + CONF_RETURNING_STATUS_VALUE, +) _LOGGER = logging.getLogger(__name__) +CURRENT_CLEANING_MODE = "Current cleaning mode" +CURRENT_FAN_SPEED = "Current fan speed" + def flow_schema(dps): """Return schema used in config flow.""" return { + vol.Required(CONF_COMMANDS_SET): str, + vol.Required(CONF_COMMANDS_DP): vol.In(dps), + vol.Required(CONF_IDLE_STATUS_VALUE): str, + vol.Required(CONF_DOCKED_STATUS_VALUE): str, + vol.Optional(CONF_RETURNING_STATUS_VALUE): str, vol.Optional(CONF_BATTERY_DP): vol.In(dps), + vol.Optional(CONF_CLEANING_MODE_DP): vol.In(dps), + vol.Optional(CONF_CLEANING_MODES, default=""): str, + vol.Optional(CONF_FAN_SPEED_DP): vol.In(dps), + vol.Optional(CONF_FAN_SPEEDS, default=""): str, } @@ -39,18 +69,53 @@ def __init__( """Initialize a new LocaltuyaVacuum.""" super().__init__(device, config_entry, switchid, **kwargs) self._state = None + self._commands_set = self._config[CONF_COMMANDS_SET] self._battery_level = None - print("Initialized vacuum [{}]".format(self.name)) + + self._cleaning_modes_list = [] + if self.has_config(CONF_CLEANING_MODES): + self._cleaning_modes_list = self._config[CONF_CLEANING_MODES].split(",") + + self._fan_speed_list = [] + if self.has_config(CONF_FAN_SPEEDS): + self._fan_speed_list = self._fan_speed_list + self._config[ + CONF_FAN_SPEEDS + ].split(",") + + self._fan_speed = "" + + self._attrs = {} + + print( + "Initialized vacuum [{}] with fan speeds [{}]".format( + self.name, self._fan_speed_list + ) + ) @property def supported_features(self): """Flag supported features.""" - return None + features = ( + SUPPORT_RETURN_HOME + | SUPPORT_PAUSE + | SUPPORT_STOP + | SUPPORT_STATUS + | SUPPORT_STATE + | SUPPORT_START + ) + if self.has_config(CONF_RETURNING_STATUS_VALUE): + features = features | SUPPORT_RETURN_HOME + if self.has_config(CONF_CLEANING_MODE_DP) or self.has_config(CONF_FAN_SPEED_DP): + features = features | SUPPORT_FAN_SPEED + if self.has_config(CONF_BATTERY_DP): + features = features | SUPPORT_BATTERY + + return features @property def state(self): """Return the vacuum state.""" - return STATE_IDLE + return self._state @property def battery_level(self): @@ -58,30 +123,43 @@ def battery_level(self): return self._battery_level @property - def cleaning_mode(self): + def device_state_attributes(self): + """Return the specific state attributes of this vacuum cleaner.""" + return self._attrs + + @property + def fan_speed(self): """Return the current cleaning mode.""" - return None + return self._fan_speed @property - def cleaning_mode_list(self): + def fan_speed_list(self) -> list: """Return the list of available fan speeds and cleaning modes.""" - # return {"smart", "spirale", "random"} - return NotImplementedError() + return self._cleaning_modes_list + self._fan_speed_list - async def async_turn_on(self, **kwargs): + @property + def error(self): + """Return error message.""" + return "" + + async def async_start(self, **kwargs): """Turn the vacuum on and start cleaning.""" + print("start [{}]".format(kwargs)) return None - async def async_turn_off(self, **kwargs): + async def async_pause(self, **kwargs): """Turn the vacuum off stopping the cleaning and returning home.""" + print("pause [{}]".format(kwargs)) return None async def async_return_to_base(self, **kwargs): """Set the vacuum cleaner to return to the dock.""" + print("return base [{}]".format(kwargs)) return None async def async_stop(self, **kwargs): """Stop the vacuum cleaner, do not return to base.""" + print("stop [{}]".format(kwargs)) return None async def async_clean_spot(self, **kwargs): @@ -92,23 +170,48 @@ async def async_locate(self, **kwargs): """Locate the vacuum cleaner.""" return None - async def async_set_cleaning_mode(self, **kwargs): + async def async_set_fan_speed(self, **kwargs): """Set the cleaning mode.""" - _LOGGER.debug("Setting cleaning mode: %r", kwargs) - return None - - async def async_send_command(self, **kwargs): - """Send a command to a vacuum cleaner.""" - _LOGGER.debug("Sending command: %r", kwargs) + fan_speed = kwargs["fan_speed"] + if fan_speed in self._cleaning_modes_list: + print("SET NEW CM [{}]".format(kwargs)) + if fan_speed in self._fan_speed_list: + print("SET NEW FL [{}]".format(kwargs)) + print("async_set_fan_speed [{}]".format(kwargs)) return None def status_updated(self): """Device status was updated.""" - print("STATUS UPDATE") - self._state = self.dps(self._dps_id) + state_value = self.dps(self._dp_id) + print("STATUS UPDATE: [{}]".format(state_value)) + """ + if state_value == self._config[CONF_IDLE_STATUS_VALUE]: + self._state = STATE_IDLE + elif state_value == self._config.get(CONF_DOCKED_STATUS_VALUE, ""): + self._state = STATE_DOCKED + elif state_value == self._config.get(CONF_RETURNING_STATUS_VALUE, ""): + self._state = STATE_RETURNING + else: + self._state = STATE_CLEANING + """ + self._state = STATE_CLEANING + print("STATUS UPDATE2: [{}]".format(self._state)) if self.has_config(CONF_BATTERY_DP): - self._battery_level = self.dps_conf(CONF_BATTERY_DP) + self._battery_level = round(self.dps_conf(CONF_BATTERY_DP) / 2300 * 100) + + self._fan_speed = "" + if self.has_config(CONF_CLEANING_MODES): + self._attrs[CURRENT_CLEANING_MODE] = self._cleaning_modes_list[0] + self._fan_speed = self._cleaning_modes_list[0] + + if self.has_config(CONF_FAN_SPEEDS): + if self._fan_speed != "": + self._fan_speed = self._fan_speed + "_" + + self._attrs[CURRENT_FAN_SPEED] = self._fan_speed_list[0] + self._fan_speed = self._fan_speed + self._fan_speed_list[0] + print("STATUS UPDATED [{}] [{}]".format(self._state, self._battery_level)) From fceedb35d148b890ad71d4b69927c5952ac28ed2 Mon Sep 17 00:00:00 2001 From: rospogrigio Date: Wed, 4 Nov 2020 23:53:28 +0100 Subject: [PATCH 7/7] Finalized vacuum.py for testing. --- custom_components/localtuya/vacuum.py | 68 +++++++++++++-------------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/custom_components/localtuya/vacuum.py b/custom_components/localtuya/vacuum.py index 646a62a42..f4c270be0 100644 --- a/custom_components/localtuya/vacuum.py +++ b/custom_components/localtuya/vacuum.py @@ -17,7 +17,7 @@ SUPPORT_STATE, SUPPORT_STATUS, SUPPORT_STOP, - VacuumEntity, + StateVacuumEntity, ) from .common import LocalTuyaEntity, async_setup_entry @@ -56,20 +56,14 @@ def flow_schema(dps): } -class LocaltuyaVacuum(LocalTuyaEntity, VacuumEntity): +class LocaltuyaVacuum(LocalTuyaEntity, StateVacuumEntity): """Tuya vacuum device.""" - def __init__( - self, - device, - config_entry, - switchid, - **kwargs, - ): + def __init__(self, device, config_entry, switchid, **kwargs): """Initialize a new LocaltuyaVacuum.""" super().__init__(device, config_entry, switchid, **kwargs) self._state = None - self._commands_set = self._config[CONF_COMMANDS_SET] + self._commands_set = self._config[CONF_COMMANDS_SET].split(",") self._battery_level = None self._cleaning_modes_list = [] @@ -144,23 +138,34 @@ def error(self): async def async_start(self, **kwargs): """Turn the vacuum on and start cleaning.""" - print("start [{}]".format(kwargs)) - return None + await self._device.set_dp(self._commands_set[0], self._config[CONF_COMMANDS_DP]) async def async_pause(self, **kwargs): - """Turn the vacuum off stopping the cleaning and returning home.""" - print("pause [{}]".format(kwargs)) - return None + """Stop the vacuum cleaner, do not return to base.""" + if len(self._commands_set) > 1: + await self._device.set_dp( + self._commands_set[1], self._config[CONF_COMMANDS_DP] + ) + else: + _LOGGER.error("Missing command for pause in commands set.") async def async_return_to_base(self, **kwargs): """Set the vacuum cleaner to return to the dock.""" - print("return base [{}]".format(kwargs)) - return None + if len(self._commands_set) > 2: + await self._device.set_dp( + self._commands_set[2], self._config[CONF_COMMANDS_DP] + ) + else: + _LOGGER.error("Missing command for pause in commands set.") async def async_stop(self, **kwargs): - """Stop the vacuum cleaner, do not return to base.""" - print("stop [{}]".format(kwargs)) - return None + """Turn the vacuum off stopping the cleaning and returning home.""" + if len(self._commands_set) > 2: + await self._device.set_dp( + self._commands_set[2], self._config[CONF_COMMANDS_DP] + ) + else: + _LOGGER.error("Missing command for pause in commands set.") async def async_clean_spot(self, **kwargs): """Perform a spot clean-up.""" @@ -174,31 +179,28 @@ async def async_set_fan_speed(self, **kwargs): """Set the cleaning mode.""" fan_speed = kwargs["fan_speed"] if fan_speed in self._cleaning_modes_list: - print("SET NEW CM [{}]".format(kwargs)) + print("SET NEW CM [{}]".format(fan_speed)) + await self._device.set_dp(fan_speed, self._config[CONF_CLEANING_MODE_DP]) if fan_speed in self._fan_speed_list: - print("SET NEW FL [{}]".format(kwargs)) - print("async_set_fan_speed [{}]".format(kwargs)) - return None + print("SET NEW FL [{}]".format(fan_speed)) + await self._device.set_dp(fan_speed, self._config[CONF_FAN_SPEED_DP]) def status_updated(self): """Device status was updated.""" - state_value = self.dps(self._dp_id) - print("STATUS UPDATE: [{}]".format(state_value)) - """ + state_value = str(self.dps(self._dp_id)) if state_value == self._config[CONF_IDLE_STATUS_VALUE]: self._state = STATE_IDLE - elif state_value == self._config.get(CONF_DOCKED_STATUS_VALUE, ""): + elif state_value == self._config[CONF_DOCKED_STATUS_VALUE]: self._state = STATE_DOCKED elif state_value == self._config.get(CONF_RETURNING_STATUS_VALUE, ""): self._state = STATE_RETURNING else: self._state = STATE_CLEANING - """ - self._state = STATE_CLEANING - print("STATUS UPDATE2: [{}]".format(self._state)) if self.has_config(CONF_BATTERY_DP): - self._battery_level = round(self.dps_conf(CONF_BATTERY_DP) / 2300 * 100) + # testing + # self._battery_level = round(self.dps_conf(CONF_BATTERY_DP) / 2300 * 100) + self._battery_level = self.dps_conf(CONF_BATTERY_DP) self._fan_speed = "" if self.has_config(CONF_CLEANING_MODES): @@ -212,7 +214,5 @@ def status_updated(self): self._attrs[CURRENT_FAN_SPEED] = self._fan_speed_list[0] self._fan_speed = self._fan_speed + self._fan_speed_list[0] - print("STATUS UPDATED [{}] [{}]".format(self._state, self._battery_level)) - async_setup_entry = partial(async_setup_entry, DOMAIN, LocaltuyaVacuum, flow_schema)