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

Classes

class  TemplateFan
 

Functions

def _async_create_entities (hass, config)
 
None async_setup_platform (HomeAssistant hass, ConfigType config, AddEntitiesCallback async_add_entities, DiscoveryInfoType|None discovery_info=None)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
list _VALID_DIRECTIONS = [DIRECTION_FORWARD, DIRECTION_REVERSE]
 
string CONF_DIRECTION_TEMPLATE = "direction_template"
 
string CONF_FANS = "fans"
 
string CONF_OFF_ACTION = "turn_off"
 
string CONF_ON_ACTION = "turn_on"
 
string CONF_OSCILLATING_TEMPLATE = "oscillating_template"
 
string CONF_PERCENTAGE_TEMPLATE = "percentage_template"
 
string CONF_PRESET_MODE_TEMPLATE = "preset_mode_template"
 
string CONF_PRESET_MODES = "preset_modes"
 
string CONF_SET_DIRECTION_ACTION = "set_direction"
 
string CONF_SET_OSCILLATING_ACTION = "set_oscillating"
 
string CONF_SET_PERCENTAGE_ACTION = "set_percentage"
 
string CONF_SET_PRESET_MODE_ACTION = "set_preset_mode"
 
string CONF_SPEED_COUNT = "speed_count"
 
 FAN_SCHEMA
 
 PLATFORM_SCHEMA
 

Detailed Description

Support for Template fans.

Function Documentation

◆ _async_create_entities()

def homeassistant.components.template.fan._async_create_entities (   hass,
  config 
)
private
Create the Template Fans.

Definition at line 92 of file fan.py.

◆ async_setup_platform()

None homeassistant.components.template.fan.async_setup_platform ( HomeAssistant  hass,
ConfigType  config,
AddEntitiesCallback  async_add_entities,
DiscoveryInfoType | None   discovery_info = None 
)
Set up the template fans.

Definition at line 113 of file fan.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 45 of file fan.py.

◆ _VALID_DIRECTIONS

list homeassistant.components.template.fan._VALID_DIRECTIONS = [DIRECTION_FORWARD, DIRECTION_REVERSE]
private

Definition at line 61 of file fan.py.

◆ CONF_DIRECTION_TEMPLATE

string homeassistant.components.template.fan.CONF_DIRECTION_TEMPLATE = "direction_template"

Definition at line 53 of file fan.py.

◆ CONF_FANS

string homeassistant.components.template.fan.CONF_FANS = "fans"

Definition at line 47 of file fan.py.

◆ CONF_OFF_ACTION

string homeassistant.components.template.fan.CONF_OFF_ACTION = "turn_off"

Definition at line 55 of file fan.py.

◆ CONF_ON_ACTION

string homeassistant.components.template.fan.CONF_ON_ACTION = "turn_on"

Definition at line 54 of file fan.py.

◆ CONF_OSCILLATING_TEMPLATE

string homeassistant.components.template.fan.CONF_OSCILLATING_TEMPLATE = "oscillating_template"

Definition at line 52 of file fan.py.

◆ CONF_PERCENTAGE_TEMPLATE

string homeassistant.components.template.fan.CONF_PERCENTAGE_TEMPLATE = "percentage_template"

Definition at line 50 of file fan.py.

◆ CONF_PRESET_MODE_TEMPLATE

string homeassistant.components.template.fan.CONF_PRESET_MODE_TEMPLATE = "preset_mode_template"

Definition at line 51 of file fan.py.

◆ CONF_PRESET_MODES

string homeassistant.components.template.fan.CONF_PRESET_MODES = "preset_modes"

Definition at line 49 of file fan.py.

◆ CONF_SET_DIRECTION_ACTION

string homeassistant.components.template.fan.CONF_SET_DIRECTION_ACTION = "set_direction"

Definition at line 58 of file fan.py.

◆ CONF_SET_OSCILLATING_ACTION

string homeassistant.components.template.fan.CONF_SET_OSCILLATING_ACTION = "set_oscillating"

Definition at line 57 of file fan.py.

◆ CONF_SET_PERCENTAGE_ACTION

string homeassistant.components.template.fan.CONF_SET_PERCENTAGE_ACTION = "set_percentage"

Definition at line 56 of file fan.py.

◆ CONF_SET_PRESET_MODE_ACTION

string homeassistant.components.template.fan.CONF_SET_PRESET_MODE_ACTION = "set_preset_mode"

Definition at line 59 of file fan.py.

◆ CONF_SPEED_COUNT

string homeassistant.components.template.fan.CONF_SPEED_COUNT = "speed_count"

Definition at line 48 of file fan.py.

◆ FAN_SCHEMA

homeassistant.components.template.fan.FAN_SCHEMA
Initial value:
1 = vol.All(
2  cv.deprecated(CONF_ENTITY_ID),
3  vol.Schema(
4  {
5  vol.Optional(CONF_FRIENDLY_NAME): cv.string,
6  vol.Optional(CONF_VALUE_TEMPLATE): cv.template,
7  vol.Optional(CONF_PERCENTAGE_TEMPLATE): cv.template,
8  vol.Optional(CONF_PRESET_MODE_TEMPLATE): cv.template,
9  vol.Optional(CONF_OSCILLATING_TEMPLATE): cv.template,
10  vol.Optional(CONF_DIRECTION_TEMPLATE): cv.template,
11  vol.Required(CONF_ON_ACTION): cv.SCRIPT_SCHEMA,
12  vol.Required(CONF_OFF_ACTION): cv.SCRIPT_SCHEMA,
13  vol.Optional(CONF_SET_PERCENTAGE_ACTION): cv.SCRIPT_SCHEMA,
14  vol.Optional(CONF_SET_PRESET_MODE_ACTION): cv.SCRIPT_SCHEMA,
15  vol.Optional(CONF_SET_OSCILLATING_ACTION): cv.SCRIPT_SCHEMA,
16  vol.Optional(CONF_SET_DIRECTION_ACTION): cv.SCRIPT_SCHEMA,
17  vol.Optional(CONF_SPEED_COUNT): vol.Coerce(int),
18  vol.Optional(CONF_PRESET_MODES): cv.ensure_list,
19  vol.Optional(CONF_ENTITY_ID): cv.entity_ids,
20  vol.Optional(CONF_UNIQUE_ID): cv.string,
21  }
22  ).extend(TEMPLATE_ENTITY_AVAILABILITY_SCHEMA_LEGACY.schema),
23 )

Definition at line 63 of file fan.py.

◆ PLATFORM_SCHEMA

homeassistant.components.template.fan.PLATFORM_SCHEMA
Initial value:
1 = cv.PLATFORM_SCHEMA.extend(
2  {vol.Required(CONF_FANS): cv.schema_with_slug_keys(FAN_SCHEMA)}
3 )

Definition at line 87 of file fan.py.