Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.fan Namespace Reference

Namespaces

 device_action
 
 device_condition
 
 device_trigger
 
 reproduce_state
 
 significant_change
 

Classes

class  FanEntity
 
class  FanEntityDescription
 
class  FanEntityFeature
 
class  NotValidPresetModeError
 

Functions

bool async_setup (HomeAssistant hass, ConfigType config)
 
bool async_setup_entry (HomeAssistant hass, ConfigEntry entry)
 
bool async_unload_entry (HomeAssistant hass, ConfigEntry entry)
 
bool is_on (HomeAssistant hass, str entity_id)
 

Variables

 __all__ = all_with_deprecated_constants(globals())
 
 __dir__
 
 __getattr__ = ft.partial(check_if_deprecated_constant, module_globals=globals())
 
 _DEPRECATED_SUPPORT_DIRECTION
 
 _DEPRECATED_SUPPORT_OSCILLATE
 
 _DEPRECATED_SUPPORT_PRESET_MODE
 
 _DEPRECATED_SUPPORT_SET_SPEED
 
 _LOGGER = logging.getLogger(__name__)
 
string ATTR_DIRECTION = "direction"
 
string ATTR_OSCILLATING = "oscillating"
 
string ATTR_PERCENTAGE = "percentage"
 
string ATTR_PERCENTAGE_STEP = "percentage_step"
 
string ATTR_PRESET_MODE = "preset_mode"
 
string ATTR_PRESET_MODES = "preset_modes"
 
dictionary CACHED_PROPERTIES_WITH_ATTR_
 
string DIRECTION_FORWARD = "forward"
 
string DIRECTION_REVERSE = "reverse"
 
string DOMAIN = "fan"
 
string ENTITY_ID_FORMAT = DOMAIN + ".{}"
 
 PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA
 
 PLATFORM_SCHEMA_BASE = cv.PLATFORM_SCHEMA_BASE
 
 SCAN_INTERVAL = timedelta(seconds=30)
 
string SERVICE_DECREASE_SPEED = "decrease_speed"
 
string SERVICE_INCREASE_SPEED = "increase_speed"
 
string SERVICE_OSCILLATE = "oscillate"
 
string SERVICE_SET_DIRECTION = "set_direction"
 
string SERVICE_SET_PERCENTAGE = "set_percentage"
 
string SERVICE_SET_PRESET_MODE = "set_preset_mode"
 

Detailed Description

Provides functionality to interact with fans.

Function Documentation

◆ async_setup()

bool homeassistant.components.fan.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Expose fan control via statemachine and services.

Definition at line 122 of file __init__.py.

◆ async_setup_entry()

bool homeassistant.components.fan.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Set up a config entry.

Definition at line 204 of file __init__.py.

◆ async_unload_entry()

bool homeassistant.components.fan.async_unload_entry ( HomeAssistant  hass,
ConfigEntry  entry 
)
Unload a config entry.

Definition at line 209 of file __init__.py.

◆ is_on()

bool homeassistant.components.fan.is_on ( HomeAssistant  hass,
str  entity_id 
)
Return if the fans are on based on the statemachine.

Definition at line 115 of file __init__.py.

Variable Documentation

◆ __all__

homeassistant.components.fan.__all__ = all_with_deprecated_constants(globals())
private

Definition at line 553 of file __init__.py.

◆ __dir__

homeassistant.components.fan.__dir__
private
Initial value:
1 = ft.partial(
2  dir_with_deprecated_constants, module_globals_keys=[*globals().keys()]
3 )

Definition at line 550 of file __init__.py.

◆ __getattr__

homeassistant.components.fan.__getattr__ = ft.partial(check_if_deprecated_constant, module_globals=globals())
private

Definition at line 549 of file __init__.py.

◆ _DEPRECATED_SUPPORT_DIRECTION

homeassistant.components.fan._DEPRECATED_SUPPORT_DIRECTION
private
Initial value:
1 = DeprecatedConstantEnum(
2  FanEntityFeature.DIRECTION, "2025.1"
3 )

Definition at line 72 of file __init__.py.

◆ _DEPRECATED_SUPPORT_OSCILLATE

homeassistant.components.fan._DEPRECATED_SUPPORT_OSCILLATE
private
Initial value:
1 = DeprecatedConstantEnum(
2  FanEntityFeature.OSCILLATE, "2025.1"
3 )

Definition at line 69 of file __init__.py.

◆ _DEPRECATED_SUPPORT_PRESET_MODE

homeassistant.components.fan._DEPRECATED_SUPPORT_PRESET_MODE
private
Initial value:
1 = DeprecatedConstantEnum(
2  FanEntityFeature.PRESET_MODE, "2025.1"
3 )

Definition at line 75 of file __init__.py.

◆ _DEPRECATED_SUPPORT_SET_SPEED

homeassistant.components.fan._DEPRECATED_SUPPORT_SET_SPEED
private
Initial value:
1 = DeprecatedConstantEnum(
2  FanEntityFeature.SET_SPEED, "2025.1"
3 )

Definition at line 66 of file __init__.py.

◆ _LOGGER

homeassistant.components.fan._LOGGER = logging.getLogger(__name__)
private

Definition at line 43 of file __init__.py.

◆ ATTR_DIRECTION

string homeassistant.components.fan.ATTR_DIRECTION = "direction"

Definition at line 92 of file __init__.py.

◆ ATTR_OSCILLATING

string homeassistant.components.fan.ATTR_OSCILLATING = "oscillating"

Definition at line 91 of file __init__.py.

◆ ATTR_PERCENTAGE

string homeassistant.components.fan.ATTR_PERCENTAGE = "percentage"

Definition at line 89 of file __init__.py.

◆ ATTR_PERCENTAGE_STEP

string homeassistant.components.fan.ATTR_PERCENTAGE_STEP = "percentage_step"

Definition at line 90 of file __init__.py.

◆ ATTR_PRESET_MODE

string homeassistant.components.fan.ATTR_PRESET_MODE = "preset_mode"

Definition at line 93 of file __init__.py.

◆ ATTR_PRESET_MODES

string homeassistant.components.fan.ATTR_PRESET_MODES = "preset_modes"

Definition at line 94 of file __init__.py.

◆ CACHED_PROPERTIES_WITH_ATTR_

dictionary homeassistant.components.fan.CACHED_PROPERTIES_WITH_ATTR_
Initial value:
1 = {
2  "percentage",
3  "speed_count",
4  "current_direction",
5  "oscillating",
6  "supported_features",
7  "preset_mode",
8  "preset_modes",
9 }

Definition at line 218 of file __init__.py.

◆ DIRECTION_FORWARD

string homeassistant.components.fan.DIRECTION_FORWARD = "forward"

Definition at line 86 of file __init__.py.

◆ DIRECTION_REVERSE

string homeassistant.components.fan.DIRECTION_REVERSE = "reverse"

Definition at line 87 of file __init__.py.

◆ DOMAIN

string homeassistant.components.fan.DOMAIN = "fan"

Definition at line 45 of file __init__.py.

◆ ENTITY_ID_FORMAT

string homeassistant.components.fan.ENTITY_ID_FORMAT = DOMAIN + ".{}"

Definition at line 47 of file __init__.py.

◆ PLATFORM_SCHEMA

homeassistant.components.fan.PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA

Definition at line 48 of file __init__.py.

◆ PLATFORM_SCHEMA_BASE

homeassistant.components.fan.PLATFORM_SCHEMA_BASE = cv.PLATFORM_SCHEMA_BASE

Definition at line 49 of file __init__.py.

◆ SCAN_INTERVAL

homeassistant.components.fan.SCAN_INTERVAL = timedelta(seconds=30)

Definition at line 50 of file __init__.py.

◆ SERVICE_DECREASE_SPEED

string homeassistant.components.fan.SERVICE_DECREASE_SPEED = "decrease_speed"

Definition at line 80 of file __init__.py.

◆ SERVICE_INCREASE_SPEED

string homeassistant.components.fan.SERVICE_INCREASE_SPEED = "increase_speed"

Definition at line 79 of file __init__.py.

◆ SERVICE_OSCILLATE

string homeassistant.components.fan.SERVICE_OSCILLATE = "oscillate"

Definition at line 81 of file __init__.py.

◆ SERVICE_SET_DIRECTION

string homeassistant.components.fan.SERVICE_SET_DIRECTION = "set_direction"

Definition at line 82 of file __init__.py.

◆ SERVICE_SET_PERCENTAGE

string homeassistant.components.fan.SERVICE_SET_PERCENTAGE = "set_percentage"

Definition at line 83 of file __init__.py.

◆ SERVICE_SET_PRESET_MODE

string homeassistant.components.fan.SERVICE_SET_PRESET_MODE = "set_preset_mode"

Definition at line 84 of file __init__.py.