1 """Support for Xiaomi Mi Air Purifier and Xiaomi Mi Air Humidifier."""
3 from __future__
import annotations
5 from abc
import abstractmethod
11 from miio.fan_common
import (
12 MoveDirection
as FanMoveDirection,
13 OperationMode
as FanOperationMode,
15 from miio.integrations.airpurifier.dmaker.airfresh_t2017
import (
16 OperationMode
as AirfreshOperationModeT2017,
18 from miio.integrations.airpurifier.zhimi.airfresh
import (
19 OperationMode
as AirfreshOperationMode,
21 from miio.integrations.airpurifier.zhimi.airpurifier
import (
22 OperationMode
as AirpurifierOperationMode,
24 from miio.integrations.airpurifier.zhimi.airpurifier_miot
import (
25 OperationMode
as AirpurifierMiotOperationMode,
27 from miio.integrations.fan.zhimi.zhimi_miot
import (
28 OperationModeFanZA5
as FanZA5OperationMode,
30 import voluptuous
as vol
39 percentage_to_ranged_value,
40 ranged_value_to_percentage,
46 FEATURE_FLAGS_AIRFRESH,
47 FEATURE_FLAGS_AIRFRESH_A1,
48 FEATURE_FLAGS_AIRFRESH_T2017,
49 FEATURE_FLAGS_AIRPURIFIER_2S,
50 FEATURE_FLAGS_AIRPURIFIER_3C,
51 FEATURE_FLAGS_AIRPURIFIER_4,
52 FEATURE_FLAGS_AIRPURIFIER_4_LITE,
53 FEATURE_FLAGS_AIRPURIFIER_MIIO,
54 FEATURE_FLAGS_AIRPURIFIER_MIOT,
55 FEATURE_FLAGS_AIRPURIFIER_PRO,
56 FEATURE_FLAGS_AIRPURIFIER_PRO_V7,
57 FEATURE_FLAGS_AIRPURIFIER_V3,
58 FEATURE_FLAGS_AIRPURIFIER_ZA1,
63 FEATURE_FLAGS_FAN_P10_P11_P18,
64 FEATURE_FLAGS_FAN_ZA5,
66 FEATURE_SET_EXTRA_FEATURES,
74 MODEL_AIRPURIFIER_3C_REV_A,
76 MODEL_AIRPURIFIER_4_LITE_RMA1,
77 MODEL_AIRPURIFIER_4_LITE_RMB1,
78 MODEL_AIRPURIFIER_4_PRO,
79 MODEL_AIRPURIFIER_PRO,
80 MODEL_AIRPURIFIER_PRO_V7,
82 MODEL_AIRPURIFIER_ZA1,
94 SERVICE_SET_EXTRA_FEATURES,
96 from .entity
import XiaomiCoordinatedMiioEntity
97 from .typing
import ServiceMethodDetails
99 _LOGGER = logging.getLogger(__name__)
101 DATA_KEY =
"fan.xiaomi_miio"
103 ATTR_MODE_NATURE =
"nature"
104 ATTR_MODE_NORMAL =
"normal"
107 ATTR_BRIGHTNESS =
"brightness"
108 ATTR_FAN_LEVEL =
"fan_level"
109 ATTR_SLEEP_TIME =
"sleep_time"
110 ATTR_SLEEP_LEARN_COUNT =
"sleep_mode_learn_count"
111 ATTR_EXTRA_FEATURES =
"extra_features"
112 ATTR_FEATURES =
"features"
113 ATTR_TURBO_MODE_SUPPORTED =
"turbo_mode_supported"
114 ATTR_SLEEP_MODE =
"sleep_mode"
115 ATTR_USE_TIME =
"use_time"
116 ATTR_BUTTON_PRESSED =
"button_pressed"
119 ATTR_FAVORITE_SPEED =
"favorite_speed"
122 ATTR_FAVORITE_RPM =
"favorite_rpm"
123 ATTR_MOTOR_SPEED =
"motor_speed"
126 AVAILABLE_ATTRIBUTES_AIRPURIFIER_COMMON = {
127 ATTR_EXTRA_FEATURES:
"extra_features",
128 ATTR_TURBO_MODE_SUPPORTED:
"turbo_mode_supported",
129 ATTR_BUTTON_PRESSED:
"button_pressed",
132 AVAILABLE_ATTRIBUTES_AIRPURIFIER = {
133 **AVAILABLE_ATTRIBUTES_AIRPURIFIER_COMMON,
134 ATTR_SLEEP_TIME:
"sleep_time",
135 ATTR_SLEEP_LEARN_COUNT:
"sleep_mode_learn_count",
136 ATTR_USE_TIME:
"use_time",
137 ATTR_SLEEP_MODE:
"sleep_mode",
140 AVAILABLE_ATTRIBUTES_AIRPURIFIER_PRO = {
141 **AVAILABLE_ATTRIBUTES_AIRPURIFIER_COMMON,
142 ATTR_USE_TIME:
"use_time",
143 ATTR_SLEEP_TIME:
"sleep_time",
144 ATTR_SLEEP_LEARN_COUNT:
"sleep_mode_learn_count",
147 AVAILABLE_ATTRIBUTES_AIRPURIFIER_MIOT = {ATTR_USE_TIME:
"use_time"}
149 AVAILABLE_ATTRIBUTES_AIRPURIFIER_PRO_V7 = AVAILABLE_ATTRIBUTES_AIRPURIFIER_COMMON
151 AVAILABLE_ATTRIBUTES_AIRPURIFIER_V3 = {
153 ATTR_SLEEP_TIME:
"sleep_time",
154 ATTR_SLEEP_LEARN_COUNT:
"sleep_mode_learn_count",
155 ATTR_EXTRA_FEATURES:
"extra_features",
156 ATTR_USE_TIME:
"use_time",
157 ATTR_BUTTON_PRESSED:
"button_pressed",
160 AVAILABLE_ATTRIBUTES_AIRFRESH = {
161 ATTR_USE_TIME:
"use_time",
162 ATTR_EXTRA_FEATURES:
"extra_features",
165 PRESET_MODES_AIRPURIFIER = [
"Auto",
"Silent",
"Favorite",
"Idle"]
166 PRESET_MODES_AIRPURIFIER_4_LITE = [
"Auto",
"Silent",
"Favorite"]
167 PRESET_MODES_AIRPURIFIER_MIOT = [
"Auto",
"Silent",
"Favorite",
"Fan"]
168 PRESET_MODES_AIRPURIFIER_PRO = [
"Auto",
"Silent",
"Favorite"]
169 PRESET_MODES_AIRPURIFIER_PRO_V7 = PRESET_MODES_AIRPURIFIER_PRO
170 PRESET_MODES_AIRPURIFIER_2S = [
"Auto",
"Silent",
"Favorite"]
171 PRESET_MODES_AIRPURIFIER_3C = [
"Auto",
"Silent",
"Favorite"]
172 PRESET_MODES_AIRPURIFIER_ZA1 = [
"Auto",
"Silent",
"Favorite"]
173 PRESET_MODES_AIRPURIFIER_V3 = [
182 PRESET_MODES_AIRFRESH = [
"Auto",
"Interval"]
183 PRESET_MODES_AIRFRESH_A1 = [
"Auto",
"Sleep",
"Favorite"]
185 AIRPURIFIER_SERVICE_SCHEMA = vol.Schema({vol.Optional(ATTR_ENTITY_ID): cv.entity_ids})
187 SERVICE_SCHEMA_EXTRA_FEATURES = AIRPURIFIER_SERVICE_SCHEMA.extend(
188 {vol.Required(ATTR_FEATURES): cv.positive_int}
191 SERVICE_TO_METHOD = {
194 method=
"async_set_extra_features",
195 schema=SERVICE_SCHEMA_EXTRA_FEATURES,
199 FAN_DIRECTIONS_MAP = {
207 config_entry: ConfigEntry,
208 async_add_entities: AddEntitiesCallback,
210 """Set up the Fan from a config entry."""
211 entities: list[FanEntity] = []
214 if config_entry.data[CONF_FLOW_TYPE] != CONF_DEVICE:
217 hass.data.setdefault(DATA_KEY, {})
219 model = config_entry.data[CONF_MODEL]
220 unique_id = config_entry.unique_id
221 coordinator = hass.data[DOMAIN][config_entry.entry_id][KEY_COORDINATOR]
222 device = hass.data[DOMAIN][config_entry.entry_id][KEY_DEVICE]
224 if model
in (MODEL_AIRPURIFIER_3C, MODEL_AIRPURIFIER_3C_REV_A):
231 elif model
in MODELS_PURIFIER_MIOT:
238 elif model.startswith(
"zhimi.airpurifier."):
240 elif model.startswith(
"zhimi.airfresh."):
241 entity =
XiaomiAirFresh(device, config_entry, unique_id, coordinator)
242 elif model == MODEL_AIRFRESH_A1:
244 elif model == MODEL_AIRFRESH_T2017:
246 elif model == MODEL_FAN_P5:
247 entity =
XiaomiFanP5(device, config_entry, unique_id, coordinator)
248 elif model
in MODELS_FAN_MIIO:
249 entity =
XiaomiFan(device, config_entry, unique_id, coordinator)
250 elif model == MODEL_FAN_ZA5:
251 entity =
XiaomiFanZA5(device, config_entry, unique_id, coordinator)
252 elif model == MODEL_FAN_1C:
253 entity =
XiaomiFan1C(device, config_entry, unique_id, coordinator)
254 elif model
in MODELS_FAN_MIOT:
255 entity =
XiaomiFanMiot(device, config_entry, unique_id, coordinator)
259 hass.data[DATA_KEY][unique_id] = entity
261 entities.append(entity)
263 async
def async_service_handler(service: ServiceCall) ->
None:
264 """Map services to methods on XiaomiAirPurifier."""
265 method = SERVICE_TO_METHOD[service.service]
267 key: value
for key, value
in service.data.items()
if key != ATTR_ENTITY_ID
269 if entity_ids := service.data.get(ATTR_ENTITY_ID):
270 filtered_entities = [
272 for entity
in hass.data[DATA_KEY].values()
273 if entity.entity_id
in entity_ids
276 filtered_entities = hass.data[DATA_KEY].values()
280 for entity
in filtered_entities:
281 entity_method = getattr(entity, method.method,
None)
282 if not entity_method:
284 await entity_method(**params)
285 update_tasks.append(asyncio.create_task(entity.async_update_ha_state(
True)))
288 await asyncio.wait(update_tasks)
290 for air_purifier_service, method
in SERVICE_TO_METHOD.items():
291 schema = method.schema
or AIRPURIFIER_SERVICE_SCHEMA
292 hass.services.async_register(
293 DOMAIN, air_purifier_service, async_service_handler, schema=schema
300 """Representation of a generic Xiaomi device."""
303 _enable_turn_on_off_backwards_compatibility =
False
305 def __init__(self, device, entry, unique_id, coordinator):
306 """Initialize the generic Xiaomi device."""
307 super().
__init__(device, entry, unique_id, coordinator)
320 """Hold operation mode class."""
324 """Get the list of available preset modes."""
329 """Return the percentage based speed of the fan."""
334 """Return the state attributes of the device."""
339 """Return true if device is on."""
344 percentage: int |
None =
None,
345 preset_mode: str |
None =
None,
348 """Turn the device on."""
349 result = await self._try_command(
350 "Turning the miio device on failed.", self._device.on
364 """Turn the device off."""
365 result = await self._try_command(
366 "Turning the miio device off failed.", self._device.off
375 """Representation of a generic AirPurifier device."""
377 def __init__(self, device, entry, unique_id, coordinator):
378 """Initialize the generic AirPurifier device."""
379 super().
__init__(device, entry, unique_id, coordinator)
385 """Return the number of speeds of the fan supported."""
390 """Get the active preset mode."""
393 return preset_mode
if preset_mode
in self.
_preset_modes_preset_modes
else None
399 """Fetch state from the device."""
403 key: self._extract_value_from_attribute(self.coordinator.data, value)
413 """Representation of a Xiaomi Air Purifier."""
415 SPEED_MODE_MAPPING = {
416 1: AirpurifierOperationMode.Silent,
417 2: AirpurifierOperationMode.Medium,
418 3: AirpurifierOperationMode.High,
419 4: AirpurifierOperationMode.Strong,
422 REVERSE_SPEED_MODE_MAPPING = {v: k
for k, v
in SPEED_MODE_MAPPING.items()}
424 def __init__(self, device, entry, unique_id, coordinator):
425 """Initialize the plug switch."""
426 super().
__init__(device, entry, unique_id, coordinator)
428 if self.
_model_model == MODEL_AIRPURIFIER_PRO:
434 elif self.
_model_model
in [MODEL_AIRPURIFIER_4, MODEL_AIRPURIFIER_4_PRO]:
439 FanEntityFeature.SET_SPEED | FanEntityFeature.PRESET_MODE
442 elif self.
_model_model
in [
443 MODEL_AIRPURIFIER_4_LITE_RMA1,
444 MODEL_AIRPURIFIER_4_LITE_RMB1,
451 elif self.
_model_model == MODEL_AIRPURIFIER_PRO_V7:
457 elif self.
_model_model
in [MODEL_AIRPURIFIER_2S, MODEL_AIRPURIFIER_2H]:
463 elif self.
_model_model == MODEL_AIRPURIFIER_ZA1:
469 elif self.
_model_model
in MODELS_PURIFIER_MIOT:
474 FanEntityFeature.SET_SPEED | FanEntityFeature.PRESET_MODE
477 elif self.
_model_model == MODEL_AIRPURIFIER_V3:
490 FanEntityFeature.TURN_OFF | FanEntityFeature.TURN_ON
496 key: self._extract_value_from_attribute(self.coordinator.data, value)
505 """Hold operation mode class."""
506 return AirpurifierOperationMode
510 """Return the current percentage based speed."""
521 """Set the percentage of the fan.
523 This method is a coroutine.
529 speed_mode = math.ceil(
533 await self._try_command(
534 "Setting operation mode of the miio device failed.",
535 self._device.set_mode,
540 """Set the preset mode of the fan.
542 This method is a coroutine.
544 if await self._try_command(
545 "Setting operation mode of the miio device failed.",
546 self._device.set_mode,
553 """Set the extra features."""
557 await self._try_command(
558 "Setting the extra features of the miio device failed.",
559 self._device.set_extra_features,
564 """Reset the filter lifetime and usage."""
568 await self._try_command(
569 "Resetting the filter lifetime of the miio device failed.",
570 self._device.reset_filter,
575 """Representation of a Xiaomi Air Purifier (MiOT protocol)."""
579 """Hold operation mode class."""
580 return AirpurifierMiotOperationMode
584 """Return the current percentage based speed."""
593 """Set the percentage of the fan.
595 This method is a coroutine.
604 if await self._try_command(
605 "Setting fan level of the miio device failed.",
606 self._device.set_fan_level,
614 """Representation of a Xiaomi Air Purifier MB4."""
616 def __init__(self, device, entry, unique_id, coordinator) -> None:
617 """Initialize Air Purifier MB4."""
618 super().
__init__(device, entry, unique_id, coordinator)
623 FanEntityFeature.SET_SPEED
624 | FanEntityFeature.PRESET_MODE
625 | FanEntityFeature.TURN_OFF
626 | FanEntityFeature.TURN_ON
637 """Hold operation mode class."""
638 return AirpurifierMiotOperationMode
642 """Return the current percentage based speed."""
654 """Set the percentage of the fan. This method is a coroutine."""
664 if await self._try_command(
665 "Setting fan level of the miio device failed.",
666 self._device.set_favorite_rpm,
674 """Set the preset mode of the fan."""
678 if await self._try_command(
679 "Setting operation mode of the miio device failed.",
680 self._device.set_mode,
688 """Fetch state from the device."""
691 self.
_favorite_rpm_favorite_rpm = getattr(self.coordinator.data, ATTR_FAVORITE_RPM,
None)
696 getattr(self.coordinator.data, ATTR_MOTOR_SPEED, 0),
703 """Representation of a Xiaomi Air Fresh."""
705 SPEED_MODE_MAPPING = {
706 1: AirfreshOperationMode.Silent,
707 2: AirfreshOperationMode.Low,
708 3: AirfreshOperationMode.Middle,
709 4: AirfreshOperationMode.Strong,
712 REVERSE_SPEED_MODE_MAPPING = {v: k
for k, v
in SPEED_MODE_MAPPING.items()}
714 PRESET_MODE_MAPPING = {
715 "Auto": AirfreshOperationMode.Auto,
716 "Interval": AirfreshOperationMode.Interval,
719 def __init__(self, device, entry, unique_id, coordinator):
720 """Initialize the miio device."""
721 super().
__init__(device, entry, unique_id, coordinator)
728 FanEntityFeature.SET_SPEED
729 | FanEntityFeature.PRESET_MODE
730 | FanEntityFeature.TURN_OFF
731 | FanEntityFeature.TURN_ON
737 key: getattr(self.coordinator.data, value)
745 """Hold operation mode class."""
746 return AirfreshOperationMode
750 """Return the current percentage based speed."""
761 """Set the percentage of the fan.
763 This method is a coroutine.
765 speed_mode = math.ceil(
769 if await self._try_command(
770 "Setting operation mode of the miio device failed.",
771 self._device.set_mode,
780 """Set the preset mode of the fan.
782 This method is a coroutine.
784 if await self._try_command(
785 "Setting operation mode of the miio device failed.",
786 self._device.set_mode,
793 """Set the extra features."""
797 await self._try_command(
798 "Setting the extra features of the miio device failed.",
799 self._device.set_extra_features,
804 """Reset the filter lifetime and usage."""
808 await self._try_command(
809 "Resetting the filter lifetime of the miio device failed.",
810 self._device.reset_filter,
815 """Representation of a Xiaomi Air Fresh A1."""
817 def __init__(self, device, entry, unique_id, coordinator):
818 """Initialize the miio device."""
819 super().
__init__(device, entry, unique_id, coordinator)
824 FanEntityFeature.SET_SPEED
825 | FanEntityFeature.PRESET_MODE
826 | FanEntityFeature.TURN_OFF
827 | FanEntityFeature.TURN_ON
836 """Hold operation mode class."""
837 return AirfreshOperationModeT2017
841 """Return the current percentage based speed."""
850 """Set the percentage of the fan. This method is a coroutine."""
857 favorite_speed = math.ceil(
860 if not favorite_speed:
862 if await self._try_command(
863 "Setting fan level of the miio device failed.",
864 self._device.set_favorite_speed,
871 """Set the preset mode of the fan. This method is a coroutine."""
872 if await self._try_command(
873 "Setting operation mode of the miio device failed.",
874 self._device.set_mode,
882 """Fetch state from the device."""
885 self.
_favorite_speed_favorite_speed = getattr(self.coordinator.data, ATTR_FAVORITE_SPEED,
None)
890 """Representation of a Xiaomi Air Fresh T2017."""
892 def __init__(self, device, entry, unique_id, coordinator):
893 """Initialize the miio device."""
894 super().
__init__(device, entry, unique_id, coordinator)
900 """Representation of a generic Xiaomi Fan."""
902 _attr_translation_key =
"generic_fan"
904 def __init__(self, device, entry, unique_id, coordinator):
905 """Initialize the fan."""
906 super().
__init__(device, entry, unique_id, coordinator)
910 elif self.
_model_model == MODEL_FAN_ZA5:
912 elif self.
_model_model == MODEL_FAN_1C:
914 elif self.
_model_model == MODEL_FAN_P9:
916 elif self.
_model_model
in (MODEL_FAN_P10, MODEL_FAN_P11, MODEL_FAN_P18):
921 FanEntityFeature.SET_SPEED
922 | FanEntityFeature.OSCILLATE
923 | FanEntityFeature.PRESET_MODE
924 | FanEntityFeature.TURN_OFF
925 | FanEntityFeature.TURN_ON
927 if self.
_model_model != MODEL_FAN_1C:
935 """Get the active preset mode."""
940 """Get the list of available preset modes."""
945 """Return the current speed as a percentage."""
953 """Return whether or not the fan is currently oscillating."""
957 """Set oscillation."""
958 await self._try_command(
959 "Setting oscillate on/off of the miio device failed.",
960 self._device.set_oscillate,
967 """Set the direction of the fan."""
971 await self._try_command(
972 "Setting move direction of the miio device failed.",
973 self._device.set_rotate,
974 FanMoveDirection(FAN_DIRECTIONS_MAP[direction]),
979 """Representation of a Xiaomi Fan."""
981 def __init__(self, device, entry, unique_id, coordinator):
982 """Initialize the fan."""
983 super().
__init__(device, entry, unique_id, coordinator)
987 self.
_nature_mode_nature_mode = self.coordinator.data.natural_speed != 0
995 """Hold operation mode class."""
999 """Get the active preset mode."""
1000 return ATTR_MODE_NATURE
if self.
_nature_mode_nature_mode
else ATTR_MODE_NORMAL
1004 """Get the list of available preset modes."""
1005 return [ATTR_MODE_NATURE, ATTR_MODE_NORMAL]
1009 """Fetch state from the device."""
1012 self.
_nature_mode_nature_mode = self.coordinator.data.natural_speed != 0
1021 """Set the preset mode of the fan."""
1022 if preset_mode == ATTR_MODE_NATURE:
1023 await self._try_command(
1024 "Setting natural fan speed percentage of the miio device failed.",
1025 self._device.set_natural_speed,
1029 await self._try_command(
1030 "Setting direct fan speed percentage of the miio device failed.",
1031 self._device.set_direct_speed,
1039 """Set the percentage of the fan."""
1046 await self._try_command(
1047 "Setting fan speed percentage of the miio device failed.",
1048 self._device.set_natural_speed,
1052 await self._try_command(
1053 "Setting fan speed percentage of the miio device failed.",
1054 self._device.set_direct_speed,
1066 """Representation of a Xiaomi Fan P5."""
1068 def __init__(self, device, entry, unique_id, coordinator):
1069 """Initialize the fan."""
1070 super().
__init__(device, entry, unique_id, coordinator)
1079 """Hold operation mode class."""
1080 return FanOperationMode
1084 """Fetch state from the device."""
1093 """Set the preset mode of the fan."""
1094 await self._try_command(
1095 "Setting operation mode of the miio device failed.",
1096 self._device.set_mode,
1103 """Set the percentage of the fan."""
1109 await self._try_command(
1110 "Setting fan speed percentage of the miio device failed.",
1111 self._device.set_speed,
1123 """Representation of a Xiaomi Fan Miot."""
1127 """Hold operation mode class."""
1128 return FanOperationMode
1132 """Get the active preset mode."""
1137 """Fetch state from the device."""
1141 if self.coordinator.data.is_on:
1149 """Set the preset mode of the fan."""
1150 await self._try_command(
1151 "Setting operation mode of the miio device failed.",
1152 self._device.set_mode,
1159 """Set the percentage of the fan."""
1165 result = await self._try_command(
1166 "Setting fan speed percentage of the miio device failed.",
1167 self._device.set_speed,
1180 """Representation of a Xiaomi Fan ZA5."""
1184 """Hold operation mode class."""
1185 return FanZA5OperationMode
1189 """Representation of a Xiaomi Fan 1C (Standing Fan 2 Lite)."""
1191 def __init__(self, device, entry, unique_id, coordinator):
1192 """Initialize MIOT fan with speed count."""
1193 super().
__init__(device, entry, unique_id, coordinator)
1198 """Fetch state from the device."""
1202 if self.coordinator.data.is_on:
1204 (1, self.
_speed_count_speed_count), self.coordinator.data.speed
1212 """Set the percentage of the fan."""
1226 result = await self._try_command(
1227 "Setting fan speed percentage of the miio device failed.",
1228 self._device.set_speed,
None async_turn_on(self, int|None percentage=None, str|None preset_mode=None, **Any kwargs)
None async_set_percentage(self, int percentage)
None async_set_preset_mode(self, str preset_mode)
None async_oscillate(self, bool oscillating)
None async_set_preset_mode(self, str preset_mode)
def __init__(self, device, entry, unique_id, coordinator)
None async_set_percentage(self, int percentage)
def _handle_coordinator_update(self)
def operation_mode_class(self)
int|None percentage(self)
def __init__(self, device, entry, unique_id, coordinator)
int|None percentage(self)
def async_set_extra_features(self, int features=1)
def __init__(self, device, entry, unique_id, coordinator)
def operation_mode_class(self)
None async_set_preset_mode(self, str preset_mode)
def async_reset_filter(self)
dictionary SPEED_MODE_MAPPING
None async_set_percentage(self, int percentage)
dictionary REVERSE_SPEED_MODE_MAPPING
int|None percentage(self)
None async_set_percentage(self, int percentage)
None __init__(self, device, entry, unique_id, coordinator)
None async_set_preset_mode(self, str preset_mode)
def operation_mode_class(self)
def _handle_coordinator_update(self)
def operation_mode_class(self)
int|None percentage(self)
None async_set_percentage(self, int percentage)
def async_set_extra_features(self, int features=1)
dictionary REVERSE_SPEED_MODE_MAPPING
def async_reset_filter(self)
def __init__(self, device, entry, unique_id, coordinator)
None async_set_percentage(self, int percentage)
def operation_mode_class(self)
dictionary SPEED_MODE_MAPPING
None async_set_preset_mode(self, str preset_mode)
int|None percentage(self)
def __init__(self, device, entry, unique_id, coordinator)
def _handle_coordinator_update(self)
None async_set_percentage(self, int percentage)
def operation_mode_class(self)
str|None preset_mode(self)
def _handle_coordinator_update(self)
None async_set_preset_mode(self, str preset_mode)
None async_set_percentage(self, int percentage)
def __init__(self, device, entry, unique_id, coordinator)
None async_set_percentage(self, int percentage)
def _handle_coordinator_update(self)
def operation_mode_class(self)
None async_set_preset_mode(self, str preset_mode)
def operation_mode_class(self)
None async_set_preset_mode(self, str preset_mode)
None async_set_percentage(self, int percentage)
def operation_mode_class(self)
def __init__(self, device, entry, unique_id, coordinator)
list[str] preset_modes(self)
def _handle_coordinator_update(self)
str|None preset_mode(self)
def __init__(self, device, entry, unique_id, coordinator)
def _handle_coordinator_update(self)
def operation_mode_class(self)
None async_turn_on(self, int|None percentage=None, str|None preset_mode=None, **Any kwargs)
def __init__(self, device, entry, unique_id, coordinator)
None async_turn_off(self, **Any kwargs)
dict[str, Any] extra_state_attributes(self)
list[str] preset_modes(self)
int|None percentage(self)
int|None percentage(self)
None async_oscillate(self, bool oscillating)
str|None preset_mode(self)
list[str] preset_modes(self)
def __init__(self, device, entry, unique_id, coordinator)
bool|None oscillating(self)
None async_set_direction(self, str direction)
None async_write_ha_state(self)
None async_turn_off(self, **Any kwargs)
None async_turn_on(self, **Any kwargs)
IssData update(pyiss.ISS iss)
None async_setup_entry(HomeAssistant hass, ConfigEntry config_entry, AddEntitiesCallback async_add_entities)
float percentage_to_ranged_value(tuple[float, float] low_high_range, float percentage)
int ranged_value_to_percentage(tuple[float, float] low_high_range, float value)