Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.fan.FanEntity Class Reference

Inherits homeassistant.helpers.entity.ToggleEntity, cached_properties, and CACHED_PROPERTIES_WITH_ATTR_.

Inherited by homeassistant.components.baf.fan.BAFFan, homeassistant.components.balboa.fan.BalboaPumpFanEntity, homeassistant.components.bond.fan.BondFan, homeassistant.components.comfoconnect.fan.ComfoConnectFan, homeassistant.components.deconz.fan.DeconzFan, homeassistant.components.demo.fan.AsyncDemoPercentageFan, homeassistant.components.demo.fan.BaseDemoFan, homeassistant.components.demo.fan.DemoPercentageFan, homeassistant.components.esphome.fan.EsphomeFan, homeassistant.components.fjaraskupan.fan.Fan, homeassistant.components.freedompro.fan.FreedomproFan, homeassistant.components.group.fan.FanGroup, homeassistant.components.homekit_controller.fan.BaseHomeKitFan, homeassistant.components.insteon.fan.InsteonFanEntity, homeassistant.components.intellifire.fan.IntellifireFan, homeassistant.components.isy994.fan.ISYFanEntity, homeassistant.components.isy994.fan.ISYFanProgramEntity, homeassistant.components.knx.fan.KNXFan, homeassistant.components.lg_thinq.fan.ThinQFanEntity, homeassistant.components.lutron.fan.LutronFan, homeassistant.components.lutron_caseta.fan.LutronCasetaFan, homeassistant.components.matter.fan.MatterFan, homeassistant.components.modbus.fan.ModbusFan, homeassistant.components.modern_forms.fan.ModernFormsFanEntity, homeassistant.components.mqtt.fan.MqttFan, homeassistant.components.netatmo.fan.NetatmoFan, homeassistant.components.rabbitair.fan.RabbitAirFanEntity, homeassistant.components.renson.fan.RensonFan, homeassistant.components.smartthings.fan.SmartThingsFan, homeassistant.components.smarty.fan.SmartyFan, homeassistant.components.snooz.fan.SnoozFan, homeassistant.components.switch_as_x.fan.FanSwitch, homeassistant.components.tasmota.fan.TasmotaFan, homeassistant.components.template.fan.TemplateFan, homeassistant.components.tolo.fan.ToloFan, homeassistant.components.tplink.fan.TPLinkFanEntity, homeassistant.components.tradfri.fan.TradfriAirPurifierFan, homeassistant.components.tuya.fan.TuyaFanEntity, homeassistant.components.vallox.fan.ValloxFanEntity, homeassistant.components.vesync.fan.VeSyncFanHA, homeassistant.components.vicare.fan.ViCareFan, homeassistant.components.wemo.fan.WemoHumidifier, homeassistant.components.wilight.fan.WiLightFan, homeassistant.components.xiaomi_miio.fan.XiaomiGenericDevice, homeassistant.components.zha.fan.ZhaFan, homeassistant.components.zwave_js.fan.ZwaveFan, homeassistant.components.zwave_js.fan.ZwaveThermostatFan, and homeassistant.components.zwave_me.fan.ZWaveMeFan.

Collaboration diagram for homeassistant.components.fan.FanEntity:
[legend]

Public Member Functions

Any __getattribute__ (self, str name)
 
None add_to_platform_start (self, HomeAssistant hass, EntityPlatform platform, asyncio.Semaphore|None parallel_updates)
 
None async_decrease_speed (self, int|None percentage_step=None)
 
None async_handle_set_preset_mode_service (self, str preset_mode)
 
None async_handle_turn_on_service (self, int|None percentage=None, str|None preset_mode=None, **Any kwargs)
 
None async_increase_speed (self, int|None percentage_step=None)
 
None async_oscillate (self, bool oscillating)
 
None async_set_direction (self, str direction)
 
None async_set_percentage (self, int percentage)
 
None async_set_preset_mode (self, str preset_mode)
 
None async_turn_on (self, int|None percentage=None, str|None preset_mode=None, **Any kwargs)
 
dict[str, list[str]|Nonecapability_attributes (self)
 
str|None current_direction (self)
 
bool|None is_on (self)
 
None oscillate (self, bool oscillating)
 
bool|None oscillating (self)
 
int|None percentage (self)
 
float percentage_step (self)
 
str|None preset_mode (self)
 
list[str]|None preset_modes (self)
 
None set_direction (self, str direction)
 
None set_percentage (self, int percentage)
 
None set_preset_mode (self, str preset_mode)
 
int speed_count (self)
 
dict[str, float|str|Nonestate_attributes (self)
 
FanEntityFeature supported_features (self)
 
None turn_on (self, int|None percentage=None, str|None preset_mode=None, **Any kwargs)
 
- Public Member Functions inherited from homeassistant.helpers.entity.ToggleEntity
None async_toggle (self, **Any kwargs)
 
None async_turn_off (self, **Any kwargs)
 
None async_turn_on (self, **Any kwargs)
 
Literal["on", "off"]|None state (self)
 
None toggle (self, **Any kwargs)
 
None turn_off (self, **Any kwargs)
 
None turn_on (self, **Any kwargs)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (self)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
bool assumed_state (self)
 
None async_added_to_hass (self)
 
None async_device_update (self, bool warning=True)
 
None async_internal_added_to_hass (self)
 
None async_internal_will_remove_from_hass (self)
 
None async_on_remove (self, CALLBACK_TYPE func)
 
None async_registry_entry_updated (self)
 
None async_remove (self, *bool force_remove=False)
 
None async_removed_from_registry (self)
 
None async_schedule_update_ha_state (self, bool force_refresh=False)
 
None async_set_context (self, Context context)
 
None async_update_ha_state (self, bool force_refresh=False)
 
None async_will_remove_from_hass (self)
 
None async_write_ha_state (self)
 
str|None attribution (self)
 
bool available (self)
 
str|None device_class (self)
 
DeviceInfo|None device_info (self)
 
bool enabled (self)
 
EntityCategory|None entity_category (self)
 
str|None entity_picture (self)
 
bool entity_registry_enabled_default (self)
 
bool entity_registry_visible_default (self)
 
Mapping[str, Any]|None extra_state_attributes (self)
 
bool force_update (self)
 
HassJobType get_hassjob_type (self, str function_name)
 
er.EntityOptionsType|None get_initial_entity_options (self)
 
bool has_entity_name (self)
 
str|None icon (self)
 
str|UndefinedType|None name (self)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (self)
 
str|None suggested_object_id (self)
 
str|None translation_key (self)
 
Mapping[str, strtranslation_placeholders (self)
 
str|None unique_id (self)
 
str|None unit_of_measurement (self)
 
bool use_device_name (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.CachedProperties
None __init__ (cls, str name, tuple[type,...] bases, dict[Any, Any] namespace, **Any kwargs)
 
Any __new__ (mcs, str name, tuple[type,...] bases, dict[Any, Any] namespace, set[str]|None cached_properties=None, **Any kwargs)
 

Static Public Attributes

 bool
 
 FanEntityFeature
 
 int
 
 None
 
- Static Public Attributes inherited from homeassistant.helpers.entity.ToggleEntity
 None
 
- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 

Private Member Functions

None _async_adjust_speed (self, int modifier, int|None percentage_step)
 
None _valid_preset_mode_or_raise (self, str preset_mode)
 

Static Private Attributes

 _entity_component_unrecorded_attributes = frozenset({ATTR_PRESET_MODES})
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Detailed Description

Base class for fan entities.

Definition at line 229 of file __init__.py.

Member Function Documentation

◆ __getattribute__()

Any homeassistant.components.fan.FanEntity.__getattribute__ (   self,
str  name 
)
Get attribute.

Modify return of `supported_features` to
include `_mod_supported_features` if attribute is set.

Definition at line 248 of file __init__.py.

◆ _async_adjust_speed()

None homeassistant.components.fan.FanEntity._async_adjust_speed (   self,
int  modifier,
int | None   percentage_step 
)
private
Increase or decrease the speed of the fan.

Definition at line 354 of file __init__.py.

◆ _valid_preset_mode_or_raise()

None homeassistant.components.fan.FanEntity._valid_preset_mode_or_raise (   self,
str  preset_mode 
)
private
Raise NotValidPresetModeError on invalid preset_mode.

Definition at line 391 of file __init__.py.

◆ add_to_platform_start()

None homeassistant.components.fan.FanEntity.add_to_platform_start (   self,
HomeAssistant  hass,
EntityPlatform  platform,
asyncio.Semaphore | None  parallel_updates 
)
Start adding an entity to a platform.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 279 of file __init__.py.

◆ async_decrease_speed()

None homeassistant.components.fan.FanEntity.async_decrease_speed (   self,
int | None   percentage_step = None 
)
Decrease the speed of the fan.

Definition at line 350 of file __init__.py.

◆ async_handle_set_preset_mode_service()

None homeassistant.components.fan.FanEntity.async_handle_set_preset_mode_service (   self,
str  preset_mode 
)
Validate and set new preset mode.

Definition at line 380 of file __init__.py.

◆ async_handle_turn_on_service()

None homeassistant.components.fan.FanEntity.async_handle_turn_on_service (   self,
int | None   percentage = None,
str | None   preset_mode = None,
**Any  kwargs 
)
Validate and turn on the fan.

Definition at line 421 of file __init__.py.

◆ async_increase_speed()

None homeassistant.components.fan.FanEntity.async_increase_speed (   self,
int | None   percentage_step = None 
)
Increase the speed of the fan.

Definition at line 346 of file __init__.py.

◆ async_oscillate()

◆ async_set_direction()

◆ async_set_percentage()

None homeassistant.components.fan.FanEntity.async_set_percentage (   self,
int  percentage 
)
Set the speed of the fan, as a percentage.

Reimplemented in homeassistant.components.zwave_js.fan.ValueMappingZwaveFan, homeassistant.components.zwave_js.fan.ZwaveFan, homeassistant.components.zha.fan.ZhaFan, homeassistant.components.xiaomi_miio.fan.XiaomiFan1C, homeassistant.components.xiaomi_miio.fan.XiaomiFanMiot, homeassistant.components.xiaomi_miio.fan.XiaomiFanP5, homeassistant.components.xiaomi_miio.fan.XiaomiFan, homeassistant.components.xiaomi_miio.fan.XiaomiAirFreshA1, homeassistant.components.xiaomi_miio.fan.XiaomiAirFresh, homeassistant.components.xiaomi_miio.fan.XiaomiAirPurifierMB4, homeassistant.components.xiaomi_miio.fan.XiaomiAirPurifierMiot, homeassistant.components.xiaomi_miio.fan.XiaomiAirPurifier, homeassistant.components.wilight.fan.WiLightFan, homeassistant.components.vallox.fan.ValloxFanEntity, homeassistant.components.tradfri.fan.TradfriAirPurifierFan, homeassistant.components.tplink.fan.TPLinkFanEntity, homeassistant.components.template.fan.TemplateFan, homeassistant.components.tasmota.fan.TasmotaFan, homeassistant.components.snooz.fan.SnoozFan, homeassistant.components.smartthings.fan.SmartThingsFan, homeassistant.components.renson.fan.RensonFan, homeassistant.components.rabbitair.fan.RabbitAirFanEntity, homeassistant.components.mqtt.fan.MqttFan, homeassistant.components.modern_forms.fan.ModernFormsFanEntity, homeassistant.components.matter.fan.MatterFan, homeassistant.components.lutron_caseta.fan.LutronCasetaFan, homeassistant.components.lg_thinq.fan.ThinQFanEntity, homeassistant.components.knx.fan.KNXFan, homeassistant.components.isy994.fan.ISYFanEntity, homeassistant.components.intellifire.fan.IntellifireFan, homeassistant.components.insteon.fan.InsteonFanEntity, homeassistant.components.homekit_controller.fan.BaseHomeKitFan, homeassistant.components.group.fan.FanGroup, homeassistant.components.freedompro.fan.FreedomproFan, homeassistant.components.fjaraskupan.fan.Fan, homeassistant.components.esphome.fan.EsphomeFan, homeassistant.components.demo.fan.AsyncDemoPercentageFan, homeassistant.components.deconz.fan.DeconzFan, homeassistant.components.bond.fan.BondFan, homeassistant.components.balboa.fan.BalboaPumpFanEntity, and homeassistant.components.baf.fan.BAFFan.

Definition at line 340 of file __init__.py.

◆ async_set_preset_mode()

◆ async_turn_on()

None homeassistant.components.fan.FanEntity.async_turn_on (   self,
int | None   percentage = None,
str | None   preset_mode = None,
**Any  kwargs 
)
Turn on the fan.

Reimplemented in homeassistant.components.zwave_js.fan.ZwaveThermostatFan, homeassistant.components.zwave_js.fan.ZwaveFan, homeassistant.components.zha.fan.ZhaFan, homeassistant.components.xiaomi_miio.fan.XiaomiGenericDevice, homeassistant.components.wilight.fan.WiLightFan, homeassistant.components.vallox.fan.ValloxFanEntity, homeassistant.components.tradfri.fan.TradfriAirPurifierFan, homeassistant.components.tplink.fan.TPLinkFanEntity, homeassistant.components.template.fan.TemplateFan, homeassistant.components.tasmota.fan.TasmotaFan, homeassistant.components.switch_as_x.fan.FanSwitch, homeassistant.components.snooz.fan.SnoozFan, homeassistant.components.smartthings.fan.SmartThingsFan, homeassistant.components.renson.fan.RensonFan, homeassistant.components.rabbitair.fan.RabbitAirFanEntity, homeassistant.components.mqtt.fan.MqttFan, homeassistant.components.modern_forms.fan.ModernFormsFanEntity, homeassistant.components.modbus.fan.ModbusFan, homeassistant.components.matter.fan.MatterFan, homeassistant.components.lutron_caseta.fan.LutronCasetaFan, homeassistant.components.lg_thinq.fan.ThinQFanEntity, homeassistant.components.knx.fan.KNXFan, homeassistant.components.isy994.fan.ISYFanProgramEntity, homeassistant.components.isy994.fan.ISYFanEntity, homeassistant.components.intellifire.fan.IntellifireFan, homeassistant.components.insteon.fan.InsteonFanEntity, homeassistant.components.homekit_controller.fan.BaseHomeKitFan, homeassistant.components.group.fan.FanGroup, homeassistant.components.freedompro.fan.FreedomproFan, homeassistant.components.fjaraskupan.fan.Fan, homeassistant.components.esphome.fan.EsphomeFan, homeassistant.components.demo.fan.AsyncDemoPercentageFan, homeassistant.components.deconz.fan.DeconzFan, homeassistant.components.bond.fan.BondFan, homeassistant.components.balboa.fan.BalboaPumpFanEntity, and homeassistant.components.baf.fan.BAFFan.

Definition at line 432 of file __init__.py.

◆ capability_attributes()

dict[str, list[str] | None] homeassistant.components.fan.FanEntity.capability_attributes (   self)
Return capability attributes.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 489 of file __init__.py.

◆ current_direction()

◆ is_on()

bool | None homeassistant.components.fan.FanEntity.is_on (   self)
Return true if the entity is on.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Reimplemented in homeassistant.components.zwave_js.fan.ZwaveThermostatFan, homeassistant.components.zwave_js.fan.ZwaveFan, homeassistant.components.xiaomi_miio.fan.XiaomiGenericDevice, homeassistant.components.wilight.fan.WiLightFan, homeassistant.components.vicare.fan.ViCareFan, homeassistant.components.vallox.fan.ValloxFanEntity, homeassistant.components.tuya.fan.TuyaFanEntity, homeassistant.components.tradfri.fan.TradfriAirPurifierFan, homeassistant.components.tolo.fan.ToloFan, homeassistant.components.template.fan.TemplateFan, homeassistant.components.switch_as_x.fan.FanSwitch, homeassistant.components.snooz.fan.SnoozFan, homeassistant.components.smarty.fan.SmartyFan, homeassistant.components.smartthings.fan.SmartThingsFan, homeassistant.components.mqtt.fan.MqttFan, homeassistant.components.modern_forms.fan.ModernFormsFanEntity, homeassistant.components.modbus.fan.ModbusFan, homeassistant.components.lutron_caseta.fan.LutronCasetaFan, homeassistant.components.isy994.fan.ISYFanProgramEntity, homeassistant.components.isy994.fan.ISYFanEntity, homeassistant.components.intellifire.fan.IntellifireFan, homeassistant.components.homekit_controller.fan.BaseHomeKitFan, homeassistant.components.group.fan.FanGroup, homeassistant.components.freedompro.fan.FreedomproFan, homeassistant.components.fjaraskupan.fan.Fan, homeassistant.components.esphome.fan.EsphomeFan, homeassistant.components.deconz.fan.DeconzFan, and homeassistant.components.balboa.fan.BalboaPumpFanEntity.

Definition at line 457 of file __init__.py.

◆ oscillate()

None homeassistant.components.fan.FanEntity.oscillate (   self,
bool  oscillating 
)
Oscillate the fan.

Reimplemented in homeassistant.components.tuya.fan.TuyaFanEntity, and homeassistant.components.demo.fan.DemoPercentageFan.

Definition at line 448 of file __init__.py.

◆ oscillating()

◆ percentage()

int | None homeassistant.components.fan.FanEntity.percentage (   self)
Return the current speed as a percentage.

Reimplemented in homeassistant.components.zwave_me.fan.ZWaveMeFan, homeassistant.components.zwave_js.fan.ValueMappingZwaveFan, homeassistant.components.zwave_js.fan.ZwaveFan, homeassistant.components.zha.fan.ZhaFan, homeassistant.components.xiaomi_miio.fan.XiaomiGenericFan, homeassistant.components.xiaomi_miio.fan.XiaomiAirFreshA1, homeassistant.components.xiaomi_miio.fan.XiaomiAirFresh, homeassistant.components.xiaomi_miio.fan.XiaomiAirPurifierMB4, homeassistant.components.xiaomi_miio.fan.XiaomiAirPurifierMiot, homeassistant.components.xiaomi_miio.fan.XiaomiAirPurifier, homeassistant.components.xiaomi_miio.fan.XiaomiGenericDevice, homeassistant.components.wilight.fan.WiLightFan, homeassistant.components.wemo.fan.WemoHumidifier, homeassistant.components.vesync.fan.VeSyncFanHA, homeassistant.components.vallox.fan.ValloxFanEntity, homeassistant.components.tuya.fan.TuyaFanEntity, homeassistant.components.tradfri.fan.TradfriAirPurifierFan, homeassistant.components.template.fan.TemplateFan, homeassistant.components.tasmota.fan.TasmotaFan, homeassistant.components.snooz.fan.SnoozFan, homeassistant.components.smarty.fan.SmartyFan, homeassistant.components.smartthings.fan.SmartThingsFan, homeassistant.components.modern_forms.fan.ModernFormsFanEntity, homeassistant.components.lutron_caseta.fan.LutronCasetaFan, homeassistant.components.knx.fan.KNXFan, homeassistant.components.isy994.fan.ISYFanProgramEntity, homeassistant.components.isy994.fan.ISYFanEntity, homeassistant.components.intellifire.fan.IntellifireFan, homeassistant.components.insteon.fan.InsteonFanEntity, homeassistant.components.homekit_controller.fan.BaseHomeKitFan, homeassistant.components.group.fan.FanGroup, homeassistant.components.fjaraskupan.fan.Fan, homeassistant.components.esphome.fan.EsphomeFan, homeassistant.components.demo.fan.AsyncDemoPercentageFan, homeassistant.components.demo.fan.DemoPercentageFan, homeassistant.components.deconz.fan.DeconzFan, homeassistant.components.comfoconnect.fan.ComfoConnectFan, homeassistant.components.bond.fan.BondFan, and homeassistant.components.balboa.fan.BalboaPumpFanEntity.

Definition at line 464 of file __init__.py.

◆ percentage_step()

float homeassistant.components.fan.FanEntity.percentage_step (   self)
Return the step size for percentage.

Reimplemented in homeassistant.components.zwave_js.fan.ValueMappingZwaveFan, and homeassistant.components.zwave_js.fan.ZwaveFan.

Definition at line 474 of file __init__.py.

◆ preset_mode()

◆ preset_modes()

◆ set_direction()

None homeassistant.components.fan.FanEntity.set_direction (   self,
str  direction 
)
Set the direction of the fan.

Reimplemented in homeassistant.components.tuya.fan.TuyaFanEntity, and homeassistant.components.demo.fan.DemoPercentageFan.

Definition at line 403 of file __init__.py.

◆ set_percentage()

◆ set_preset_mode()

◆ speed_count()

◆ state_attributes()

dict[str, float | str | None] homeassistant.components.fan.FanEntity.state_attributes (   self)
Return optional state attributes.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 504 of file __init__.py.

◆ supported_features()

◆ turn_on()

Member Data Documentation

◆ _entity_component_unrecorded_attributes

homeassistant.components.fan.FanEntity._entity_component_unrecorded_attributes = frozenset({ATTR_PRESET_MODES})
staticprivate

Definition at line 232 of file __init__.py.

◆ bool

homeassistant.components.fan.FanEntity.bool
static

Definition at line 246 of file __init__.py.

◆ FanEntityFeature

homeassistant.components.fan.FanEntity.FanEntityFeature
static

Definition at line 241 of file __init__.py.

◆ int

homeassistant.components.fan.FanEntity.int
static

Definition at line 240 of file __init__.py.

◆ None

homeassistant.components.fan.FanEntity.None
static

Definition at line 235 of file __init__.py.


The documentation for this class was generated from the following file: