Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.mqtt.fan.MqttFan Class Reference
Inheritance diagram for homeassistant.components.mqtt.fan.MqttFan:
[legend]
Collaboration diagram for homeassistant.components.mqtt.fan.MqttFan:
[legend]

Public Member Functions

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_off (self, **Any kwargs)
 
None async_turn_on (self, int|None percentage=None, str|None preset_mode=None, **Any kwargs)
 
bool|None is_on (self)
 
- Public Member Functions inherited from homeassistant.components.mqtt.entity.MqttEntity
None __init__ (self, HomeAssistant hass, ConfigType config, ConfigEntry config_entry, DiscoveryInfoType|None discovery_data)
 
bool add_subscription (self, str state_topic_config_key, Callable[[ReceiveMessage], None] msg_callback, set[str]|None tracked_attributes, bool disable_encoding=False)
 
None async_added_to_hass (self)
 
None async_publish (self, str topic, PublishPayloadType payload, int qos=0, bool retain=False, str|None encoding=DEFAULT_ENCODING)
 
None async_publish_with_config (self, str topic, PublishPayloadType payload)
 
None async_will_remove_from_hass (self)
 
None discovery_update (self, MQTTDiscoveryPayload discovery_payload)
 
None mqtt_async_added_to_hass (self)
 
- Public Member Functions inherited from homeassistant.components.mqtt.entity.MqttAttributesMixin
None __init__ (self, ConfigType config)
 
None attributes_discovery_update (self, DiscoveryInfoType config)
 
None attributes_prepare_discovery_update (self, DiscoveryInfoType config)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (self)
 
bool assumed_state (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_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_write_ha_state (self)
 
str|None attribution (self)
 
str|None device_class (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)
 
- Public Member Functions inherited from homeassistant.components.mqtt.entity.MqttAvailabilityMixin
None __init__ (self, ConfigType config)
 
None async_mqtt_connection_state_changed (self, bool state)
 
None availability_discovery_update (self, DiscoveryInfoType config)
 
None availability_prepare_discovery_update (self, DiscoveryInfoType config)
 
bool available (self)
 
- Public Member Functions inherited from homeassistant.components.mqtt.entity.MqttDiscoveryUpdateMixin
None __init__ (self, HomeAssistant hass, DiscoveryInfoType|None discovery_data, Callable[[MQTTDiscoveryPayload], Coroutine[Any, Any, None]]|None discovery_update=None)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
None async_removed_from_registry (self)
 
- Public Member Functions inherited from homeassistant.components.mqtt.entity.MqttEntityDeviceInfo
None __init__ (self, dict[str, Any]|None specifications, ConfigEntry config_entry)
 
DeviceInfo|None device_info (self)
 
None device_info_discovery_update (self, DiscoveryInfoType config)
 
- Public Member Functions inherited from homeassistant.components.fan.FanEntity
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)
 
dict[str, list[str]|Nonecapability_attributes (self)
 
str|None current_direction (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_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)
 

Static Public Member Functions

VolSchemaType config_schema ()
 

Static Public Attributes

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

Private Member Functions

None _direction_received (self, ReceiveMessage msg)
 
None _oscillation_received (self, ReceiveMessage msg)
 
None _percentage_received (self, ReceiveMessage msg)
 
None _prepare_subscribe_topics (self)
 
None _preset_mode_received (self, ReceiveMessage msg)
 
None _setup_from_config (self, ConfigType config)
 
None _state_received (self, ReceiveMessage msg)
 
None _subscribe_topics (self)
 

Private Attributes

 _attr_assumed_state
 
 _attr_current_direction
 
 _attr_is_on
 
 _attr_oscillating
 
 _attr_percentage
 
 _attr_preset_mode
 
 _attr_preset_modes
 
 _attr_speed_count
 
 _attr_supported_features
 
 _command_templates
 
 _feature_percentage
 
 _feature_preset_mode
 
 _optimistic
 
 _optimistic_direction
 
 _optimistic_oscillation
 
 _optimistic_percentage
 
 _optimistic_preset_mode
 
 _payload
 
 _speed_range
 
 _topic
 
 _value_templates
 

Static Private Attributes

 _attributes_extra_blocked = MQTT_FAN_ATTRIBUTES_BLOCKED
 
 _default_name = DEFAULT_NAME
 
bool _enable_turn_on_off_backwards_compatibility = False
 
 _entity_id_format = fan.ENTITY_ID_FORMAT
 

Additional Inherited Members

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

Detailed Description

A MQTT fan component.

Definition at line 207 of file fan.py.

Member Function Documentation

◆ _direction_received()

None homeassistant.components.mqtt.fan.MqttFan._direction_received (   self,
ReceiveMessage  msg 
)
private
Handle new received MQTT message for the direction.

Definition at line 425 of file fan.py.

◆ _oscillation_received()

None homeassistant.components.mqtt.fan.MqttFan._oscillation_received (   self,
ReceiveMessage  msg 
)
private
Handle new received MQTT message for the oscillation.

Definition at line 413 of file fan.py.

◆ _percentage_received()

None homeassistant.components.mqtt.fan.MqttFan._percentage_received (   self,
ReceiveMessage  msg 
)
private
Handle new received MQTT message for the percentage.

Definition at line 352 of file fan.py.

◆ _prepare_subscribe_topics()

None homeassistant.components.mqtt.fan.MqttFan._prepare_subscribe_topics (   self)
private
(Re)Subscribe to topics.

Reimplemented from homeassistant.components.mqtt.entity.MqttEntity.

Definition at line 434 of file fan.py.

◆ _preset_mode_received()

None homeassistant.components.mqtt.fan.MqttFan._preset_mode_received (   self,
ReceiveMessage  msg 
)
private
Handle new received MQTT message for preset mode.

Definition at line 392 of file fan.py.

◆ _setup_from_config()

None homeassistant.components.mqtt.fan.MqttFan._setup_from_config (   self,
ConfigType  config 
)
private
(Re)Setup the entity.

Reimplemented from homeassistant.components.mqtt.entity.MqttEntity.

Definition at line 236 of file fan.py.

◆ _state_received()

None homeassistant.components.mqtt.fan.MqttFan._state_received (   self,
ReceiveMessage  msg 
)
private
Handle new received MQTT message.

Definition at line 338 of file fan.py.

◆ _subscribe_topics()

None homeassistant.components.mqtt.fan.MqttFan._subscribe_topics (   self)
private
(Re)Subscribe to topics.

Reimplemented from homeassistant.components.mqtt.entity.MqttEntity.

Definition at line 457 of file fan.py.

◆ async_oscillate()

None homeassistant.components.mqtt.fan.MqttFan.async_oscillate (   self,
bool  oscillating 
)
Set oscillation.

This method is a coroutine.

Reimplemented from homeassistant.components.fan.FanEntity.

Definition at line 531 of file fan.py.

◆ async_set_direction()

None homeassistant.components.mqtt.fan.MqttFan.async_set_direction (   self,
str  direction 
)
Set direction.

This method is a coroutine.

Reimplemented from homeassistant.components.fan.FanEntity.

Definition at line 551 of file fan.py.

◆ async_set_percentage()

None homeassistant.components.mqtt.fan.MqttFan.async_set_percentage (   self,
int  percentage 
)
Set the percentage of the fan.

This method is a coroutine.

Reimplemented from homeassistant.components.fan.FanEntity.

Definition at line 502 of file fan.py.

◆ async_set_preset_mode()

None homeassistant.components.mqtt.fan.MqttFan.async_set_preset_mode (   self,
str  preset_mode 
)
Set the preset mode of the fan.

This method is a coroutine.

Reimplemented from homeassistant.components.fan.FanEntity.

Definition at line 518 of file fan.py.

◆ async_turn_off()

None homeassistant.components.mqtt.fan.MqttFan.async_turn_off (   self,
**Any  kwargs 
)
Turn off the entity.

This method is a coroutine.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 489 of file fan.py.

◆ async_turn_on()

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

This method is a coroutine.

Reimplemented from homeassistant.components.fan.FanEntity.

Definition at line 467 of file fan.py.

◆ config_schema()

VolSchemaType homeassistant.components.mqtt.fan.MqttFan.config_schema ( )
static
Return the config schema.

Reimplemented from homeassistant.components.mqtt.entity.MqttEntity.

Definition at line 232 of file fan.py.

◆ is_on()

bool | None homeassistant.components.mqtt.fan.MqttFan.is_on (   self)
Return true if device is on.

Reimplemented from homeassistant.components.fan.FanEntity.

Definition at line 462 of file fan.py.

Member Data Documentation

◆ _attr_assumed_state

homeassistant.components.mqtt.fan.MqttFan._attr_assumed_state
private

Definition at line 281 of file fan.py.

◆ _attr_current_direction

homeassistant.components.mqtt.fan.MqttFan._attr_current_direction
private

Definition at line 431 of file fan.py.

◆ _attr_is_on

homeassistant.components.mqtt.fan.MqttFan._attr_is_on
private

Definition at line 345 of file fan.py.

◆ _attr_oscillating

homeassistant.components.mqtt.fan.MqttFan._attr_oscillating
private

Definition at line 420 of file fan.py.

◆ _attr_percentage

homeassistant.components.mqtt.fan.MqttFan._attr_percentage
private

Definition at line 361 of file fan.py.

◆ _attr_preset_mode

homeassistant.components.mqtt.fan.MqttFan._attr_preset_mode
private

Definition at line 396 of file fan.py.

◆ _attr_preset_modes

homeassistant.components.mqtt.fan.MqttFan._attr_preset_modes
private

Definition at line 269 of file fan.py.

◆ _attr_speed_count

homeassistant.components.mqtt.fan.MqttFan._attr_speed_count
private

Definition at line 273 of file fan.py.

◆ _attr_supported_features

homeassistant.components.mqtt.fan.MqttFan._attr_supported_features
private

Definition at line 295 of file fan.py.

◆ _attributes_extra_blocked

homeassistant.components.mqtt.fan.MqttFan._attributes_extra_blocked = MQTT_FAN_ATTRIBUTES_BLOCKED
staticprivate

Definition at line 215 of file fan.py.

◆ _command_templates

homeassistant.components.mqtt.fan.MqttFan._command_templates
private

Definition at line 318 of file fan.py.

◆ _default_name

homeassistant.components.mqtt.fan.MqttFan._default_name = DEFAULT_NAME
staticprivate

Definition at line 213 of file fan.py.

◆ _enable_turn_on_off_backwards_compatibility

bool homeassistant.components.mqtt.fan.MqttFan._enable_turn_on_off_backwards_compatibility = False
staticprivate

Definition at line 229 of file fan.py.

◆ _entity_id_format

homeassistant.components.mqtt.fan.MqttFan._entity_id_format = fan.ENTITY_ID_FORMAT
staticprivate

Definition at line 214 of file fan.py.

◆ _feature_percentage

homeassistant.components.mqtt.fan.MqttFan._feature_percentage
private

Definition at line 266 of file fan.py.

◆ _feature_preset_mode

homeassistant.components.mqtt.fan.MqttFan._feature_preset_mode
private

Definition at line 267 of file fan.py.

◆ _optimistic

homeassistant.components.mqtt.fan.MqttFan._optimistic
private

Definition at line 280 of file fan.py.

◆ _optimistic_direction

homeassistant.components.mqtt.fan.MqttFan._optimistic_direction
private

Definition at line 282 of file fan.py.

◆ _optimistic_oscillation

homeassistant.components.mqtt.fan.MqttFan._optimistic_oscillation
private

Definition at line 285 of file fan.py.

◆ _optimistic_percentage

homeassistant.components.mqtt.fan.MqttFan._optimistic_percentage
private

Definition at line 288 of file fan.py.

◆ _optimistic_preset_mode

homeassistant.components.mqtt.fan.MqttFan._optimistic_preset_mode
private

Definition at line 291 of file fan.py.

◆ _payload

homeassistant.components.mqtt.fan.MqttFan._payload
private

Definition at line 257 of file fan.py.

◆ _speed_range

homeassistant.components.mqtt.fan.MqttFan._speed_range
private

Definition at line 238 of file fan.py.

◆ _topic

homeassistant.components.mqtt.fan.MqttFan._topic
private

Definition at line 242 of file fan.py.

◆ _value_templates

homeassistant.components.mqtt.fan.MqttFan._value_templates
private

Definition at line 330 of file fan.py.

◆ None

homeassistant.components.mqtt.fan.MqttFan.None
static

Definition at line 210 of file fan.py.


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