Migrate Xiaomi Miio to new entity naming style - part 1 (#75350)
This commit is contained in:
parent
cd223d91bb
commit
503b31fb15
10 changed files with 103 additions and 125 deletions
|
@ -57,13 +57,13 @@ class XiaomiMiioBinarySensorDescription(BinarySensorEntityDescription):
|
|||
BINARY_SENSOR_TYPES = (
|
||||
XiaomiMiioBinarySensorDescription(
|
||||
key=ATTR_NO_WATER,
|
||||
name="Water Tank Empty",
|
||||
name="Water tank empty",
|
||||
icon="mdi:water-off-outline",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
XiaomiMiioBinarySensorDescription(
|
||||
key=ATTR_WATER_TANK_DETACHED,
|
||||
name="Water Tank",
|
||||
name="Water tank",
|
||||
icon="mdi:car-coolant-level",
|
||||
device_class=BinarySensorDeviceClass.CONNECTIVITY,
|
||||
value=lambda value: not value,
|
||||
|
@ -71,13 +71,13 @@ BINARY_SENSOR_TYPES = (
|
|||
),
|
||||
XiaomiMiioBinarySensorDescription(
|
||||
key=ATTR_PTC_STATUS,
|
||||
name="Auxiliary Heat Status",
|
||||
name="Auxiliary heat status",
|
||||
device_class=BinarySensorDeviceClass.POWER,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
XiaomiMiioBinarySensorDescription(
|
||||
key=ATTR_POWERSUPPLY_ATTACHED,
|
||||
name="Power Supply",
|
||||
name="Power supply",
|
||||
device_class=BinarySensorDeviceClass.PLUG,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
|
@ -89,7 +89,7 @@ FAN_ZA5_BINARY_SENSORS = (ATTR_POWERSUPPLY_ATTACHED,)
|
|||
VACUUM_SENSORS = {
|
||||
ATTR_MOP_ATTACHED: XiaomiMiioBinarySensorDescription(
|
||||
key=ATTR_WATER_BOX_ATTACHED,
|
||||
name="Mop Attached",
|
||||
name="Mop attached",
|
||||
icon="mdi:square-rounded",
|
||||
parent_key=VacuumCoordinatorDataAttributes.status,
|
||||
entity_registry_enabled_default=True,
|
||||
|
@ -98,7 +98,7 @@ VACUUM_SENSORS = {
|
|||
),
|
||||
ATTR_WATER_BOX_ATTACHED: XiaomiMiioBinarySensorDescription(
|
||||
key=ATTR_WATER_BOX_ATTACHED,
|
||||
name="Water Box Attached",
|
||||
name="Water box attached",
|
||||
icon="mdi:water",
|
||||
parent_key=VacuumCoordinatorDataAttributes.status,
|
||||
entity_registry_enabled_default=True,
|
||||
|
@ -107,7 +107,7 @@ VACUUM_SENSORS = {
|
|||
),
|
||||
ATTR_WATER_SHORTAGE: XiaomiMiioBinarySensorDescription(
|
||||
key=ATTR_WATER_SHORTAGE,
|
||||
name="Water Shortage",
|
||||
name="Water shortage",
|
||||
icon="mdi:water",
|
||||
parent_key=VacuumCoordinatorDataAttributes.status,
|
||||
entity_registry_enabled_default=True,
|
||||
|
@ -120,7 +120,7 @@ VACUUM_SENSORS_SEPARATE_MOP = {
|
|||
**VACUUM_SENSORS,
|
||||
ATTR_MOP_ATTACHED: XiaomiMiioBinarySensorDescription(
|
||||
key=ATTR_MOP_ATTACHED,
|
||||
name="Mop Attached",
|
||||
name="Mop attached",
|
||||
icon="mdi:square-rounded",
|
||||
parent_key=VacuumCoordinatorDataAttributes.status,
|
||||
entity_registry_enabled_default=True,
|
||||
|
@ -158,7 +158,6 @@ def _setup_vacuum_sensors(hass, config_entry, async_add_entities):
|
|||
continue
|
||||
entities.append(
|
||||
XiaomiGenericBinarySensor(
|
||||
f"{config_entry.title} {description.name}",
|
||||
device,
|
||||
config_entry,
|
||||
f"{sensor}_{config_entry.unique_id}",
|
||||
|
@ -199,7 +198,6 @@ async def async_setup_entry(
|
|||
continue
|
||||
entities.append(
|
||||
XiaomiGenericBinarySensor(
|
||||
f"{config_entry.title} {description.name}",
|
||||
hass.data[DOMAIN][config_entry.entry_id][KEY_DEVICE],
|
||||
config_entry,
|
||||
f"{description.key}_{config_entry.unique_id}",
|
||||
|
@ -216,9 +214,9 @@ class XiaomiGenericBinarySensor(XiaomiCoordinatedMiioEntity, BinarySensorEntity)
|
|||
|
||||
entity_description: XiaomiMiioBinarySensorDescription
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator, description):
|
||||
def __init__(self, device, entry, unique_id, coordinator, description):
|
||||
"""Initialize the entity."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
self.entity_description = description
|
||||
self._attr_entity_registry_enabled_default = (
|
||||
|
|
|
@ -38,7 +38,7 @@ class XiaomiMiioButtonDescription(ButtonEntityDescription):
|
|||
BUTTON_TYPES = (
|
||||
XiaomiMiioButtonDescription(
|
||||
key=ATTR_RESET_DUST_FILTER,
|
||||
name="Reset Dust Filter",
|
||||
name="Reset dust filter",
|
||||
icon="mdi:air-filter",
|
||||
method_press="reset_dust_filter",
|
||||
method_press_error_message="Resetting the dust filter lifetime failed",
|
||||
|
@ -46,7 +46,7 @@ BUTTON_TYPES = (
|
|||
),
|
||||
XiaomiMiioButtonDescription(
|
||||
key=ATTR_RESET_UPPER_FILTER,
|
||||
name="Reset Upper Filter",
|
||||
name="Reset upper filter",
|
||||
icon="mdi:air-filter",
|
||||
method_press="reset_upper_filter",
|
||||
method_press_error_message="Resetting the upper filter lifetime failed.",
|
||||
|
@ -86,7 +86,6 @@ async def async_setup_entry(
|
|||
|
||||
entities.append(
|
||||
XiaomiGenericCoordinatedButton(
|
||||
f"{config_entry.title} {description.name}",
|
||||
device,
|
||||
config_entry,
|
||||
f"{description.key}_{unique_id}",
|
||||
|
@ -105,9 +104,9 @@ class XiaomiGenericCoordinatedButton(XiaomiCoordinatedMiioEntity, ButtonEntity):
|
|||
|
||||
_attr_device_class = ButtonDeviceClass.RESTART
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator, description):
|
||||
def __init__(self, device, entry, unique_id, coordinator, description):
|
||||
"""Initialize the plug switch."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
self.entity_description = description
|
||||
|
||||
async def async_press(self) -> None:
|
||||
|
|
|
@ -110,7 +110,9 @@ class XiaomiMiioEntity(Entity):
|
|||
class XiaomiCoordinatedMiioEntity(CoordinatorEntity[_T]):
|
||||
"""Representation of a base a coordinated Xiaomi Miio Entity."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
_attr_has_entity_name = True
|
||||
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the coordinated Xiaomi Miio Device."""
|
||||
super().__init__(coordinator)
|
||||
self._device = device
|
||||
|
@ -119,18 +121,12 @@ class XiaomiCoordinatedMiioEntity(CoordinatorEntity[_T]):
|
|||
self._device_id = entry.unique_id
|
||||
self._device_name = entry.title
|
||||
self._unique_id = unique_id
|
||||
self._name = name
|
||||
|
||||
@property
|
||||
def unique_id(self):
|
||||
"""Return an unique ID."""
|
||||
return self._unique_id
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Return the name of this entity, if any."""
|
||||
return self._name
|
||||
|
||||
@property
|
||||
def device_info(self) -> DeviceInfo:
|
||||
"""Return the device info."""
|
||||
|
|
|
@ -191,7 +191,6 @@ async def async_setup_entry(
|
|||
|
||||
hass.data.setdefault(DATA_KEY, {})
|
||||
|
||||
name = config_entry.title
|
||||
model = config_entry.data[CONF_MODEL]
|
||||
unique_id = config_entry.unique_id
|
||||
coordinator = hass.data[DOMAIN][config_entry.entry_id][KEY_COORDINATOR]
|
||||
|
@ -199,7 +198,6 @@ async def async_setup_entry(
|
|||
|
||||
if model == MODEL_AIRPURIFIER_3C:
|
||||
entity = XiaomiAirPurifierMB4(
|
||||
name,
|
||||
device,
|
||||
config_entry,
|
||||
unique_id,
|
||||
|
@ -207,28 +205,27 @@ async def async_setup_entry(
|
|||
)
|
||||
elif model in MODELS_PURIFIER_MIOT:
|
||||
entity = XiaomiAirPurifierMiot(
|
||||
name,
|
||||
device,
|
||||
config_entry,
|
||||
unique_id,
|
||||
coordinator,
|
||||
)
|
||||
elif model.startswith("zhimi.airpurifier."):
|
||||
entity = XiaomiAirPurifier(name, device, config_entry, unique_id, coordinator)
|
||||
entity = XiaomiAirPurifier(device, config_entry, unique_id, coordinator)
|
||||
elif model.startswith("zhimi.airfresh."):
|
||||
entity = XiaomiAirFresh(name, device, config_entry, unique_id, coordinator)
|
||||
entity = XiaomiAirFresh(device, config_entry, unique_id, coordinator)
|
||||
elif model == MODEL_AIRFRESH_A1:
|
||||
entity = XiaomiAirFreshA1(name, device, config_entry, unique_id, coordinator)
|
||||
entity = XiaomiAirFreshA1(device, config_entry, unique_id, coordinator)
|
||||
elif model == MODEL_AIRFRESH_T2017:
|
||||
entity = XiaomiAirFreshT2017(name, device, config_entry, unique_id, coordinator)
|
||||
entity = XiaomiAirFreshT2017(device, config_entry, unique_id, coordinator)
|
||||
elif model == MODEL_FAN_P5:
|
||||
entity = XiaomiFanP5(name, device, config_entry, unique_id, coordinator)
|
||||
entity = XiaomiFanP5(device, config_entry, unique_id, coordinator)
|
||||
elif model in MODELS_FAN_MIIO:
|
||||
entity = XiaomiFan(name, device, config_entry, unique_id, coordinator)
|
||||
entity = XiaomiFan(device, config_entry, unique_id, coordinator)
|
||||
elif model == MODEL_FAN_ZA5:
|
||||
entity = XiaomiFanZA5(name, device, config_entry, unique_id, coordinator)
|
||||
entity = XiaomiFanZA5(device, config_entry, unique_id, coordinator)
|
||||
elif model in MODELS_FAN_MIOT:
|
||||
entity = XiaomiFanMiot(name, device, config_entry, unique_id, coordinator)
|
||||
entity = XiaomiFanMiot(device, config_entry, unique_id, coordinator)
|
||||
else:
|
||||
return
|
||||
|
||||
|
@ -277,9 +274,9 @@ async def async_setup_entry(
|
|||
class XiaomiGenericDevice(XiaomiCoordinatedMiioEntity, FanEntity):
|
||||
"""Representation of a generic Xiaomi device."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the generic Xiaomi device."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
self._available_attributes = {}
|
||||
self._state = None
|
||||
|
@ -349,9 +346,9 @@ class XiaomiGenericDevice(XiaomiCoordinatedMiioEntity, FanEntity):
|
|||
class XiaomiGenericAirPurifier(XiaomiGenericDevice):
|
||||
"""Representation of a generic AirPurifier device."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the generic AirPurifier device."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
self._speed_count = 100
|
||||
|
||||
|
@ -396,9 +393,9 @@ class XiaomiAirPurifier(XiaomiGenericAirPurifier):
|
|||
|
||||
REVERSE_SPEED_MODE_MAPPING = {v: k for k, v in SPEED_MODE_MAPPING.items()}
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the plug switch."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
if self._model == MODEL_AIRPURIFIER_PRO:
|
||||
self._device_features = FEATURE_FLAGS_AIRPURIFIER_PRO
|
||||
|
@ -565,9 +562,9 @@ class XiaomiAirPurifierMiot(XiaomiAirPurifier):
|
|||
class XiaomiAirPurifierMB4(XiaomiGenericAirPurifier):
|
||||
"""Representation of a Xiaomi Air Purifier MB4."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize Air Purifier MB4."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
self._device_features = FEATURE_FLAGS_AIRPURIFIER_3C
|
||||
self._preset_modes = PRESET_MODES_AIRPURIFIER_3C
|
||||
|
@ -619,9 +616,9 @@ class XiaomiAirFresh(XiaomiGenericAirPurifier):
|
|||
"Interval": AirfreshOperationMode.Interval,
|
||||
}
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the miio device."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
self._device_features = FEATURE_FLAGS_AIRFRESH
|
||||
self._available_attributes = AVAILABLE_ATTRIBUTES_AIRFRESH
|
||||
|
@ -717,9 +714,9 @@ class XiaomiAirFresh(XiaomiGenericAirPurifier):
|
|||
class XiaomiAirFreshA1(XiaomiGenericAirPurifier):
|
||||
"""Representation of a Xiaomi Air Fresh A1."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the miio device."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
self._favorite_speed = None
|
||||
self._device_features = FEATURE_FLAGS_AIRFRESH_A1
|
||||
self._preset_modes = PRESET_MODES_AIRFRESH_A1
|
||||
|
@ -792,9 +789,9 @@ class XiaomiAirFreshA1(XiaomiGenericAirPurifier):
|
|||
class XiaomiAirFreshT2017(XiaomiAirFreshA1):
|
||||
"""Representation of a Xiaomi Air Fresh T2017."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the miio device."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
self._device_features = FEATURE_FLAGS_AIRFRESH_T2017
|
||||
self._speed_range = (60, 300)
|
||||
|
||||
|
@ -802,9 +799,9 @@ class XiaomiAirFreshT2017(XiaomiAirFreshA1):
|
|||
class XiaomiGenericFan(XiaomiGenericDevice):
|
||||
"""Representation of a generic Xiaomi Fan."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the fan."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
if self._model == MODEL_FAN_P5:
|
||||
self._device_features = FEATURE_FLAGS_FAN_P5
|
||||
|
@ -877,9 +874,9 @@ class XiaomiGenericFan(XiaomiGenericDevice):
|
|||
class XiaomiFan(XiaomiGenericFan):
|
||||
"""Representation of a Xiaomi Fan."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the fan."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
self._state = self.coordinator.data.is_on
|
||||
self._oscillating = self.coordinator.data.oscillate
|
||||
|
@ -968,9 +965,9 @@ class XiaomiFan(XiaomiGenericFan):
|
|||
class XiaomiFanP5(XiaomiGenericFan):
|
||||
"""Representation of a Xiaomi Fan P5."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the fan."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
self._state = self.coordinator.data.is_on
|
||||
self._preset_mode = self.coordinator.data.mode.name
|
||||
|
|
|
@ -73,12 +73,10 @@ async def async_setup_entry(
|
|||
model = config_entry.data[CONF_MODEL]
|
||||
unique_id = config_entry.unique_id
|
||||
coordinator = hass.data[DOMAIN][config_entry.entry_id][KEY_COORDINATOR]
|
||||
name = config_entry.title
|
||||
|
||||
if model in MODELS_HUMIDIFIER_MIOT:
|
||||
air_humidifier = hass.data[DOMAIN][config_entry.entry_id][KEY_DEVICE]
|
||||
entity = XiaomiAirHumidifierMiot(
|
||||
name,
|
||||
air_humidifier,
|
||||
config_entry,
|
||||
unique_id,
|
||||
|
@ -87,7 +85,6 @@ async def async_setup_entry(
|
|||
elif model in MODELS_HUMIDIFIER_MJJSQ:
|
||||
air_humidifier = hass.data[DOMAIN][config_entry.entry_id][KEY_DEVICE]
|
||||
entity = XiaomiAirHumidifierMjjsq(
|
||||
name,
|
||||
air_humidifier,
|
||||
config_entry,
|
||||
unique_id,
|
||||
|
@ -96,7 +93,6 @@ async def async_setup_entry(
|
|||
else:
|
||||
air_humidifier = hass.data[DOMAIN][config_entry.entry_id][KEY_DEVICE]
|
||||
entity = XiaomiAirHumidifier(
|
||||
name,
|
||||
air_humidifier,
|
||||
config_entry,
|
||||
unique_id,
|
||||
|
@ -115,9 +111,9 @@ class XiaomiGenericHumidifier(XiaomiCoordinatedMiioEntity, HumidifierEntity):
|
|||
_attr_supported_features = HumidifierEntityFeature.MODES
|
||||
supported_features: int
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the generic Xiaomi device."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator=coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator=coordinator)
|
||||
|
||||
self._state = None
|
||||
self._attributes = {}
|
||||
|
@ -173,9 +169,9 @@ class XiaomiAirHumidifier(XiaomiGenericHumidifier, HumidifierEntity):
|
|||
|
||||
available_modes: list[str]
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator):
|
||||
def __init__(self, device, entry, unique_id, coordinator):
|
||||
"""Initialize the plug switch."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
self._attr_min_humidity = 30
|
||||
self._attr_max_humidity = 80
|
||||
|
|
|
@ -107,7 +107,7 @@ class OscillationAngleValues:
|
|||
NUMBER_TYPES = {
|
||||
FEATURE_SET_MOTOR_SPEED: XiaomiMiioNumberDescription(
|
||||
key=ATTR_MOTOR_SPEED,
|
||||
name="Motor Speed",
|
||||
name="Motor speed",
|
||||
icon="mdi:fast-forward-outline",
|
||||
native_unit_of_measurement="rpm",
|
||||
native_min_value=200,
|
||||
|
@ -119,7 +119,7 @@ NUMBER_TYPES = {
|
|||
),
|
||||
FEATURE_SET_FAVORITE_LEVEL: XiaomiMiioNumberDescription(
|
||||
key=ATTR_FAVORITE_LEVEL,
|
||||
name="Favorite Level",
|
||||
name="Favorite level",
|
||||
icon="mdi:star-cog",
|
||||
native_min_value=0,
|
||||
native_max_value=17,
|
||||
|
@ -129,7 +129,7 @@ NUMBER_TYPES = {
|
|||
),
|
||||
FEATURE_SET_FAN_LEVEL: XiaomiMiioNumberDescription(
|
||||
key=ATTR_FAN_LEVEL,
|
||||
name="Fan Level",
|
||||
name="Fan level",
|
||||
icon="mdi:fan",
|
||||
native_min_value=1,
|
||||
native_max_value=3,
|
||||
|
@ -149,7 +149,7 @@ NUMBER_TYPES = {
|
|||
),
|
||||
FEATURE_SET_OSCILLATION_ANGLE: XiaomiMiioNumberDescription(
|
||||
key=ATTR_OSCILLATION_ANGLE,
|
||||
name="Oscillation Angle",
|
||||
name="Oscillation angle",
|
||||
icon="mdi:angle-acute",
|
||||
native_unit_of_measurement=DEGREE,
|
||||
native_min_value=1,
|
||||
|
@ -160,7 +160,7 @@ NUMBER_TYPES = {
|
|||
),
|
||||
FEATURE_SET_DELAY_OFF_COUNTDOWN: XiaomiMiioNumberDescription(
|
||||
key=ATTR_DELAY_OFF_COUNTDOWN,
|
||||
name="Delay Off Countdown",
|
||||
name="Delay off countdown",
|
||||
icon="mdi:fan-off",
|
||||
native_unit_of_measurement=TIME_MINUTES,
|
||||
native_min_value=0,
|
||||
|
@ -171,7 +171,7 @@ NUMBER_TYPES = {
|
|||
),
|
||||
FEATURE_SET_LED_BRIGHTNESS: XiaomiMiioNumberDescription(
|
||||
key=ATTR_LED_BRIGHTNESS,
|
||||
name="Led Brightness",
|
||||
name="LED brightness",
|
||||
icon="mdi:brightness-6",
|
||||
native_min_value=0,
|
||||
native_max_value=100,
|
||||
|
@ -181,7 +181,7 @@ NUMBER_TYPES = {
|
|||
),
|
||||
FEATURE_SET_LED_BRIGHTNESS_LEVEL: XiaomiMiioNumberDescription(
|
||||
key=ATTR_LED_BRIGHTNESS_LEVEL,
|
||||
name="Led Brightness",
|
||||
name="LED brightness",
|
||||
icon="mdi:brightness-6",
|
||||
native_min_value=0,
|
||||
native_max_value=8,
|
||||
|
@ -191,7 +191,7 @@ NUMBER_TYPES = {
|
|||
),
|
||||
FEATURE_SET_FAVORITE_RPM: XiaomiMiioNumberDescription(
|
||||
key=ATTR_FAVORITE_RPM,
|
||||
name="Favorite Motor Speed",
|
||||
name="Favorite motor speed",
|
||||
icon="mdi:star-cog",
|
||||
native_unit_of_measurement="rpm",
|
||||
native_min_value=300,
|
||||
|
@ -283,7 +283,6 @@ async def async_setup_entry(
|
|||
|
||||
entities.append(
|
||||
XiaomiNumberEntity(
|
||||
f"{config_entry.title} {description.name}",
|
||||
device,
|
||||
config_entry,
|
||||
f"{description.key}_{config_entry.unique_id}",
|
||||
|
@ -298,9 +297,9 @@ async def async_setup_entry(
|
|||
class XiaomiNumberEntity(XiaomiCoordinatedMiioEntity, NumberEntity):
|
||||
"""Representation of a generic Xiaomi attribute selector."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator, description):
|
||||
def __init__(self, device, entry, unique_id, coordinator, description):
|
||||
"""Initialize the generic Xiaomi attribute selector."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
self._attr_native_value = self._extract_value_from_attribute(
|
||||
coordinator.data, description.key
|
||||
|
|
|
@ -110,7 +110,6 @@ async def async_setup_entry(
|
|||
description = SELECTOR_TYPES[FEATURE_SET_LED_BRIGHTNESS]
|
||||
entities.append(
|
||||
entity_class(
|
||||
f"{config_entry.title} {description.name}",
|
||||
device,
|
||||
config_entry,
|
||||
f"{description.key}_{config_entry.unique_id}",
|
||||
|
@ -125,9 +124,9 @@ async def async_setup_entry(
|
|||
class XiaomiSelector(XiaomiCoordinatedMiioEntity, SelectEntity):
|
||||
"""Representation of a generic Xiaomi attribute selector."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator, description):
|
||||
def __init__(self, device, entry, unique_id, coordinator, description):
|
||||
"""Initialize the generic Xiaomi attribute selector."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
self._attr_options = list(description.options)
|
||||
self.entity_description = description
|
||||
|
||||
|
@ -135,9 +134,9 @@ class XiaomiSelector(XiaomiCoordinatedMiioEntity, SelectEntity):
|
|||
class XiaomiAirHumidifierSelector(XiaomiSelector):
|
||||
"""Representation of a Xiaomi Air Humidifier selector."""
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator, description):
|
||||
def __init__(self, device, entry, unique_id, coordinator, description):
|
||||
"""Initialize the plug switch."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator, description)
|
||||
super().__init__(device, entry, unique_id, coordinator, description)
|
||||
self._current_led_brightness = self._extract_value_from_attribute(
|
||||
self.coordinator.data, self.entity_description.key
|
||||
)
|
||||
|
|
|
@ -172,13 +172,13 @@ SENSOR_TYPES = {
|
|||
),
|
||||
ATTR_LOAD_POWER: XiaomiMiioSensorDescription(
|
||||
key=ATTR_LOAD_POWER,
|
||||
name="Load Power",
|
||||
name="Load power",
|
||||
native_unit_of_measurement=POWER_WATT,
|
||||
device_class=SensorDeviceClass.POWER,
|
||||
),
|
||||
ATTR_WATER_LEVEL: XiaomiMiioSensorDescription(
|
||||
key=ATTR_WATER_LEVEL,
|
||||
name="Water Level",
|
||||
name="Water level",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:water-check",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -186,7 +186,7 @@ SENSOR_TYPES = {
|
|||
),
|
||||
ATTR_ACTUAL_SPEED: XiaomiMiioSensorDescription(
|
||||
key=ATTR_ACTUAL_SPEED,
|
||||
name="Actual Speed",
|
||||
name="Actual speed",
|
||||
native_unit_of_measurement="rpm",
|
||||
icon="mdi:fast-forward",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -194,7 +194,7 @@ SENSOR_TYPES = {
|
|||
),
|
||||
ATTR_CONTROL_SPEED: XiaomiMiioSensorDescription(
|
||||
key=ATTR_CONTROL_SPEED,
|
||||
name="Control Speed",
|
||||
name="Control speed",
|
||||
native_unit_of_measurement="rpm",
|
||||
icon="mdi:fast-forward",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -202,7 +202,7 @@ SENSOR_TYPES = {
|
|||
),
|
||||
ATTR_FAVORITE_SPEED: XiaomiMiioSensorDescription(
|
||||
key=ATTR_FAVORITE_SPEED,
|
||||
name="Favorite Speed",
|
||||
name="Favorite speed",
|
||||
native_unit_of_measurement="rpm",
|
||||
icon="mdi:fast-forward",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -210,7 +210,7 @@ SENSOR_TYPES = {
|
|||
),
|
||||
ATTR_MOTOR_SPEED: XiaomiMiioSensorDescription(
|
||||
key=ATTR_MOTOR_SPEED,
|
||||
name="Motor Speed",
|
||||
name="Motor speed",
|
||||
native_unit_of_measurement="rpm",
|
||||
icon="mdi:fast-forward",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -218,7 +218,7 @@ SENSOR_TYPES = {
|
|||
),
|
||||
ATTR_MOTOR2_SPEED: XiaomiMiioSensorDescription(
|
||||
key=ATTR_MOTOR2_SPEED,
|
||||
name="Second Motor Speed",
|
||||
name="Second motor speed",
|
||||
native_unit_of_measurement="rpm",
|
||||
icon="mdi:fast-forward",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -226,7 +226,7 @@ SENSOR_TYPES = {
|
|||
),
|
||||
ATTR_USE_TIME: XiaomiMiioSensorDescription(
|
||||
key=ATTR_USE_TIME,
|
||||
name="Use Time",
|
||||
name="Use time",
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
icon="mdi:progress-clock",
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
|
@ -269,7 +269,7 @@ SENSOR_TYPES = {
|
|||
),
|
||||
ATTR_FILTER_LIFE_REMAINING: XiaomiMiioSensorDescription(
|
||||
key=ATTR_FILTER_LIFE_REMAINING,
|
||||
name="Filter Life Remaining",
|
||||
name="Filter life remaining",
|
||||
native_unit_of_measurement=PERCENTAGE,
|
||||
icon="mdi:air-filter",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -278,7 +278,7 @@ SENSOR_TYPES = {
|
|||
),
|
||||
ATTR_FILTER_USE: XiaomiMiioSensorDescription(
|
||||
key=ATTR_FILTER_HOURS_USED,
|
||||
name="Filter Use",
|
||||
name="Filter use",
|
||||
native_unit_of_measurement=TIME_HOURS,
|
||||
icon="mdi:clock-outline",
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -320,14 +320,14 @@ SENSOR_TYPES = {
|
|||
),
|
||||
ATTR_CARBON_DIOXIDE: XiaomiMiioSensorDescription(
|
||||
key=ATTR_CARBON_DIOXIDE,
|
||||
name="Carbon Dioxide",
|
||||
name="Carbon dioxide",
|
||||
native_unit_of_measurement=CONCENTRATION_PARTS_PER_MILLION,
|
||||
device_class=SensorDeviceClass.CO2,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
),
|
||||
ATTR_PURIFY_VOLUME: XiaomiMiioSensorDescription(
|
||||
key=ATTR_PURIFY_VOLUME,
|
||||
name="Purify Volume",
|
||||
name="Purify volume",
|
||||
native_unit_of_measurement=VOLUME_CUBIC_METERS,
|
||||
device_class=SensorDeviceClass.GAS,
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
|
@ -491,7 +491,7 @@ VACUUM_SENSORS = {
|
|||
f"dnd_{ATTR_DND_START}": XiaomiMiioSensorDescription(
|
||||
key=ATTR_DND_START,
|
||||
icon="mdi:minus-circle-off",
|
||||
name="DnD Start",
|
||||
name="DnD start",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
parent_key=VacuumCoordinatorDataAttributes.dnd_status,
|
||||
entity_registry_enabled_default=False,
|
||||
|
@ -500,7 +500,7 @@ VACUUM_SENSORS = {
|
|||
f"dnd_{ATTR_DND_END}": XiaomiMiioSensorDescription(
|
||||
key=ATTR_DND_END,
|
||||
icon="mdi:minus-circle-off",
|
||||
name="DnD End",
|
||||
name="DnD end",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
parent_key=VacuumCoordinatorDataAttributes.dnd_status,
|
||||
entity_registry_enabled_default=False,
|
||||
|
@ -509,7 +509,7 @@ VACUUM_SENSORS = {
|
|||
f"last_clean_{ATTR_LAST_CLEAN_START}": XiaomiMiioSensorDescription(
|
||||
key=ATTR_LAST_CLEAN_START,
|
||||
icon="mdi:clock-time-twelve",
|
||||
name="Last Clean Start",
|
||||
name="Last clean start",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
parent_key=VacuumCoordinatorDataAttributes.last_clean_details,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
|
@ -519,7 +519,7 @@ VACUUM_SENSORS = {
|
|||
icon="mdi:clock-time-twelve",
|
||||
device_class=SensorDeviceClass.TIMESTAMP,
|
||||
parent_key=VacuumCoordinatorDataAttributes.last_clean_details,
|
||||
name="Last Clean End",
|
||||
name="Last clean end",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
f"last_clean_{ATTR_LAST_CLEAN_TIME}": XiaomiMiioSensorDescription(
|
||||
|
@ -527,7 +527,7 @@ VACUUM_SENSORS = {
|
|||
icon="mdi:timer-sand",
|
||||
key=ATTR_LAST_CLEAN_TIME,
|
||||
parent_key=VacuumCoordinatorDataAttributes.last_clean_details,
|
||||
name="Last Clean Duration",
|
||||
name="Last clean duration",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
f"last_clean_{ATTR_LAST_CLEAN_AREA}": XiaomiMiioSensorDescription(
|
||||
|
@ -535,7 +535,7 @@ VACUUM_SENSORS = {
|
|||
icon="mdi:texture-box",
|
||||
key=ATTR_LAST_CLEAN_AREA,
|
||||
parent_key=VacuumCoordinatorDataAttributes.last_clean_details,
|
||||
name="Last Clean Area",
|
||||
name="Last clean area",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
f"current_{ATTR_STATUS_CLEAN_TIME}": XiaomiMiioSensorDescription(
|
||||
|
@ -543,7 +543,7 @@ VACUUM_SENSORS = {
|
|||
icon="mdi:timer-sand",
|
||||
key=ATTR_STATUS_CLEAN_TIME,
|
||||
parent_key=VacuumCoordinatorDataAttributes.status,
|
||||
name="Current Clean Duration",
|
||||
name="Current clean duration",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
f"current_{ATTR_LAST_CLEAN_AREA}": XiaomiMiioSensorDescription(
|
||||
|
@ -552,7 +552,7 @@ VACUUM_SENSORS = {
|
|||
key=ATTR_STATUS_CLEAN_AREA,
|
||||
parent_key=VacuumCoordinatorDataAttributes.status,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
name="Current Clean Area",
|
||||
name="Current clean area",
|
||||
),
|
||||
f"clean_history_{ATTR_CLEAN_HISTORY_TOTAL_DURATION}": XiaomiMiioSensorDescription(
|
||||
native_unit_of_measurement=TIME_SECONDS,
|
||||
|
@ -568,7 +568,7 @@ VACUUM_SENSORS = {
|
|||
icon="mdi:texture-box",
|
||||
key=ATTR_CLEAN_HISTORY_TOTAL_AREA,
|
||||
parent_key=VacuumCoordinatorDataAttributes.clean_history_status,
|
||||
name="Total Clean Area",
|
||||
name="Total clean area",
|
||||
entity_registry_enabled_default=False,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
|
@ -578,17 +578,17 @@ VACUUM_SENSORS = {
|
|||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
key=ATTR_CLEAN_HISTORY_COUNT,
|
||||
parent_key=VacuumCoordinatorDataAttributes.clean_history_status,
|
||||
name="Total Clean Count",
|
||||
name="Total clean count",
|
||||
entity_registry_enabled_default=False,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
f"clean_history_{ATTR_CLEAN_HISTORY_DUST_COLLECTION_COUNT}": XiaomiMiioSensorDescription(
|
||||
native_unit_of_measurement="",
|
||||
icon="mdi:counter",
|
||||
state_class="total_increasing",
|
||||
state_class=SensorStateClass.TOTAL_INCREASING,
|
||||
key=ATTR_CLEAN_HISTORY_DUST_COLLECTION_COUNT,
|
||||
parent_key=VacuumCoordinatorDataAttributes.clean_history_status,
|
||||
name="Total Dust Collection Count",
|
||||
name="Total dust collection count",
|
||||
entity_registry_enabled_default=False,
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
|
@ -597,7 +597,7 @@ VACUUM_SENSORS = {
|
|||
icon="mdi:brush",
|
||||
key=ATTR_CONSUMABLE_STATUS_MAIN_BRUSH_LEFT,
|
||||
parent_key=VacuumCoordinatorDataAttributes.consumable_status,
|
||||
name="Main Brush Left",
|
||||
name="Main brush left",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
f"consumable_{ATTR_CONSUMABLE_STATUS_SIDE_BRUSH_LEFT}": XiaomiMiioSensorDescription(
|
||||
|
@ -605,7 +605,7 @@ VACUUM_SENSORS = {
|
|||
icon="mdi:brush",
|
||||
key=ATTR_CONSUMABLE_STATUS_SIDE_BRUSH_LEFT,
|
||||
parent_key=VacuumCoordinatorDataAttributes.consumable_status,
|
||||
name="Side Brush Left",
|
||||
name="Side brush left",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
f"consumable_{ATTR_CONSUMABLE_STATUS_FILTER_LEFT}": XiaomiMiioSensorDescription(
|
||||
|
@ -613,7 +613,7 @@ VACUUM_SENSORS = {
|
|||
icon="mdi:air-filter",
|
||||
key=ATTR_CONSUMABLE_STATUS_FILTER_LEFT,
|
||||
parent_key=VacuumCoordinatorDataAttributes.consumable_status,
|
||||
name="Filter Left",
|
||||
name="Filter left",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
f"consumable_{ATTR_CONSUMABLE_STATUS_SENSOR_DIRTY_LEFT}": XiaomiMiioSensorDescription(
|
||||
|
@ -621,7 +621,7 @@ VACUUM_SENSORS = {
|
|||
icon="mdi:eye-outline",
|
||||
key=ATTR_CONSUMABLE_STATUS_SENSOR_DIRTY_LEFT,
|
||||
parent_key=VacuumCoordinatorDataAttributes.consumable_status,
|
||||
name="Sensor Dirty Left",
|
||||
name="Sensor dirty left",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
),
|
||||
}
|
||||
|
@ -644,7 +644,6 @@ def _setup_vacuum_sensors(hass, config_entry, async_add_entities):
|
|||
continue
|
||||
entities.append(
|
||||
XiaomiGenericSensor(
|
||||
f"{config_entry.title} {description.name}",
|
||||
device,
|
||||
config_entry,
|
||||
f"{sensor}_{config_entry.unique_id}",
|
||||
|
@ -741,7 +740,6 @@ async def async_setup_entry(
|
|||
continue
|
||||
entities.append(
|
||||
XiaomiGenericSensor(
|
||||
f"{config_entry.title} {description.name}",
|
||||
device,
|
||||
config_entry,
|
||||
f"{sensor}_{config_entry.unique_id}",
|
||||
|
@ -758,9 +756,9 @@ class XiaomiGenericSensor(XiaomiCoordinatedMiioEntity, SensorEntity):
|
|||
|
||||
entity_description: XiaomiMiioSensorDescription
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator, description):
|
||||
def __init__(self, device, entry, unique_id, coordinator, description):
|
||||
"""Initialize the entity."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
self.entity_description = description
|
||||
self._attr_unique_id = unique_id
|
||||
self._attr_native_value = self._determine_native_value()
|
||||
|
|
|
@ -231,7 +231,7 @@ SWITCH_TYPES = (
|
|||
XiaomiMiioSwitchDescription(
|
||||
key=ATTR_CHILD_LOCK,
|
||||
feature=FEATURE_SET_CHILD_LOCK,
|
||||
name="Child Lock",
|
||||
name="Child lock",
|
||||
icon="mdi:lock",
|
||||
method_on="async_set_child_lock_on",
|
||||
method_off="async_set_child_lock_off",
|
||||
|
@ -249,7 +249,7 @@ SWITCH_TYPES = (
|
|||
XiaomiMiioSwitchDescription(
|
||||
key=ATTR_DRY,
|
||||
feature=FEATURE_SET_DRY,
|
||||
name="Dry Mode",
|
||||
name="Dry mode",
|
||||
icon="mdi:hair-dryer",
|
||||
method_on="async_set_dry_on",
|
||||
method_off="async_set_dry_off",
|
||||
|
@ -258,7 +258,7 @@ SWITCH_TYPES = (
|
|||
XiaomiMiioSwitchDescription(
|
||||
key=ATTR_CLEAN,
|
||||
feature=FEATURE_SET_CLEAN,
|
||||
name="Clean Mode",
|
||||
name="Clean mode",
|
||||
icon="mdi:shimmer",
|
||||
method_on="async_set_clean_on",
|
||||
method_off="async_set_clean_off",
|
||||
|
@ -268,7 +268,7 @@ SWITCH_TYPES = (
|
|||
XiaomiMiioSwitchDescription(
|
||||
key=ATTR_LED,
|
||||
feature=FEATURE_SET_LED,
|
||||
name="Led",
|
||||
name="LED",
|
||||
icon="mdi:led-outline",
|
||||
method_on="async_set_led_on",
|
||||
method_off="async_set_led_off",
|
||||
|
@ -277,7 +277,7 @@ SWITCH_TYPES = (
|
|||
XiaomiMiioSwitchDescription(
|
||||
key=ATTR_LEARN_MODE,
|
||||
feature=FEATURE_SET_LEARN_MODE,
|
||||
name="Learn Mode",
|
||||
name="Learn mode",
|
||||
icon="mdi:school-outline",
|
||||
method_on="async_set_learn_mode_on",
|
||||
method_off="async_set_learn_mode_off",
|
||||
|
@ -286,7 +286,7 @@ SWITCH_TYPES = (
|
|||
XiaomiMiioSwitchDescription(
|
||||
key=ATTR_AUTO_DETECT,
|
||||
feature=FEATURE_SET_AUTO_DETECT,
|
||||
name="Auto Detect",
|
||||
name="Auto detect",
|
||||
method_on="async_set_auto_detect_on",
|
||||
method_off="async_set_auto_detect_off",
|
||||
entity_category=EntityCategory.CONFIG,
|
||||
|
@ -303,7 +303,7 @@ SWITCH_TYPES = (
|
|||
XiaomiMiioSwitchDescription(
|
||||
key=ATTR_PTC,
|
||||
feature=FEATURE_SET_PTC,
|
||||
name="Auxiliary Heat",
|
||||
name="Auxiliary heat",
|
||||
icon="mdi:radiator",
|
||||
method_on="async_set_ptc_on",
|
||||
method_off="async_set_ptc_off",
|
||||
|
@ -353,7 +353,6 @@ async def async_setup_coordinated_entry(hass, config_entry, async_add_entities):
|
|||
if description.feature & device_features:
|
||||
entities.append(
|
||||
XiaomiGenericCoordinatedSwitch(
|
||||
f"{config_entry.title} {description.name}",
|
||||
device,
|
||||
config_entry,
|
||||
f"{description.key}_{unique_id}",
|
||||
|
@ -490,9 +489,9 @@ class XiaomiGenericCoordinatedSwitch(XiaomiCoordinatedMiioEntity, SwitchEntity):
|
|||
|
||||
entity_description: XiaomiMiioSwitchDescription
|
||||
|
||||
def __init__(self, name, device, entry, unique_id, coordinator, description):
|
||||
def __init__(self, device, entry, unique_id, coordinator, description):
|
||||
"""Initialize the plug switch."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
|
||||
self._attr_is_on = self._extract_value_from_attribute(
|
||||
self.coordinator.data, description.key
|
||||
|
|
|
@ -86,11 +86,9 @@ async def async_setup_entry(
|
|||
entities = []
|
||||
|
||||
if config_entry.data[CONF_FLOW_TYPE] == CONF_DEVICE:
|
||||
name = config_entry.title
|
||||
unique_id = config_entry.unique_id
|
||||
|
||||
mirobo = MiroboVacuum(
|
||||
name,
|
||||
hass.data[DOMAIN][config_entry.entry_id][KEY_DEVICE],
|
||||
config_entry,
|
||||
unique_id,
|
||||
|
@ -201,14 +199,13 @@ class MiroboVacuum(
|
|||
|
||||
def __init__(
|
||||
self,
|
||||
name,
|
||||
device,
|
||||
entry,
|
||||
unique_id,
|
||||
coordinator: DataUpdateCoordinator[VacuumCoordinatorData],
|
||||
):
|
||||
"""Initialize the Xiaomi vacuum cleaner robot handler."""
|
||||
super().__init__(name, device, entry, unique_id, coordinator)
|
||||
super().__init__(device, entry, unique_id, coordinator)
|
||||
self._state: str | None = None
|
||||
|
||||
async def async_added_to_hass(self) -> None:
|
||||
|
|
Loading…
Add table
Reference in a new issue