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

Classes

class  LightTemplate
 

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_STATES = [STATE_ON, STATE_OFF, "true", "false"]
 
string CONF_COLOR_ACTION = "set_color"
 
string CONF_COLOR_TEMPLATE = "color_template"
 
string CONF_EFFECT_ACTION = "set_effect"
 
string CONF_EFFECT_LIST_TEMPLATE = "effect_list_template"
 
string CONF_EFFECT_TEMPLATE = "effect_template"
 
string CONF_HS_ACTION = "set_hs"
 
string CONF_HS_TEMPLATE = "hs_template"
 
string CONF_LEVEL_ACTION = "set_level"
 
string CONF_LEVEL_TEMPLATE = "level_template"
 
string CONF_MAX_MIREDS_TEMPLATE = "max_mireds_template"
 
string CONF_MIN_MIREDS_TEMPLATE = "min_mireds_template"
 
string CONF_OFF_ACTION = "turn_off"
 
string CONF_ON_ACTION = "turn_on"
 
string CONF_RGB_ACTION = "set_rgb"
 
string CONF_RGB_TEMPLATE = "rgb_template"
 
string CONF_RGBW_ACTION = "set_rgbw"
 
string CONF_RGBW_TEMPLATE = "rgbw_template"
 
string CONF_RGBWW_ACTION = "set_rgbww"
 
string CONF_RGBWW_TEMPLATE = "rgbww_template"
 
string CONF_SUPPORTS_TRANSITION = "supports_transition_template"
 
string CONF_TEMPERATURE_ACTION = "set_temperature"
 
string CONF_TEMPERATURE_TEMPLATE = "temperature_template"
 
string CONF_WHITE_VALUE_ACTION = "set_white_value"
 
string CONF_WHITE_VALUE_TEMPLATE = "white_value_template"
 
 LIGHT_SCHEMA
 
 PLATFORM_SCHEMA
 

Detailed Description

Support for Template lights.

Function Documentation

◆ _async_create_entities()

def homeassistant.components.template.light._async_create_entities (   hass,
  config 
)
private
Create the Template Lights.

Definition at line 124 of file light.py.

◆ async_setup_platform()

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

Definition at line 144 of file light.py.

Variable Documentation

◆ _LOGGER

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

Definition at line 50 of file light.py.

◆ _VALID_STATES

list homeassistant.components.template.light._VALID_STATES = [STATE_ON, STATE_OFF, "true", "false"]
private

Definition at line 51 of file light.py.

◆ CONF_COLOR_ACTION

string homeassistant.components.template.light.CONF_COLOR_ACTION = "set_color"

Definition at line 54 of file light.py.

◆ CONF_COLOR_TEMPLATE

string homeassistant.components.template.light.CONF_COLOR_TEMPLATE = "color_template"

Definition at line 55 of file light.py.

◆ CONF_EFFECT_ACTION

string homeassistant.components.template.light.CONF_EFFECT_ACTION = "set_effect"

Definition at line 65 of file light.py.

◆ CONF_EFFECT_LIST_TEMPLATE

string homeassistant.components.template.light.CONF_EFFECT_LIST_TEMPLATE = "effect_list_template"

Definition at line 66 of file light.py.

◆ CONF_EFFECT_TEMPLATE

string homeassistant.components.template.light.CONF_EFFECT_TEMPLATE = "effect_template"

Definition at line 67 of file light.py.

◆ CONF_HS_ACTION

string homeassistant.components.template.light.CONF_HS_ACTION = "set_hs"

Definition at line 57 of file light.py.

◆ CONF_HS_TEMPLATE

string homeassistant.components.template.light.CONF_HS_TEMPLATE = "hs_template"

Definition at line 58 of file light.py.

◆ CONF_LEVEL_ACTION

string homeassistant.components.template.light.CONF_LEVEL_ACTION = "set_level"

Definition at line 68 of file light.py.

◆ CONF_LEVEL_TEMPLATE

string homeassistant.components.template.light.CONF_LEVEL_TEMPLATE = "level_template"

Definition at line 69 of file light.py.

◆ CONF_MAX_MIREDS_TEMPLATE

string homeassistant.components.template.light.CONF_MAX_MIREDS_TEMPLATE = "max_mireds_template"

Definition at line 70 of file light.py.

◆ CONF_MIN_MIREDS_TEMPLATE

string homeassistant.components.template.light.CONF_MIN_MIREDS_TEMPLATE = "min_mireds_template"

Definition at line 71 of file light.py.

◆ CONF_OFF_ACTION

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

Definition at line 72 of file light.py.

◆ CONF_ON_ACTION

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

Definition at line 73 of file light.py.

◆ CONF_RGB_ACTION

string homeassistant.components.template.light.CONF_RGB_ACTION = "set_rgb"

Definition at line 59 of file light.py.

◆ CONF_RGB_TEMPLATE

string homeassistant.components.template.light.CONF_RGB_TEMPLATE = "rgb_template"

Definition at line 60 of file light.py.

◆ CONF_RGBW_ACTION

string homeassistant.components.template.light.CONF_RGBW_ACTION = "set_rgbw"

Definition at line 61 of file light.py.

◆ CONF_RGBW_TEMPLATE

string homeassistant.components.template.light.CONF_RGBW_TEMPLATE = "rgbw_template"

Definition at line 62 of file light.py.

◆ CONF_RGBWW_ACTION

string homeassistant.components.template.light.CONF_RGBWW_ACTION = "set_rgbww"

Definition at line 63 of file light.py.

◆ CONF_RGBWW_TEMPLATE

string homeassistant.components.template.light.CONF_RGBWW_TEMPLATE = "rgbww_template"

Definition at line 64 of file light.py.

◆ CONF_SUPPORTS_TRANSITION

string homeassistant.components.template.light.CONF_SUPPORTS_TRANSITION = "supports_transition_template"

Definition at line 74 of file light.py.

◆ CONF_TEMPERATURE_ACTION

string homeassistant.components.template.light.CONF_TEMPERATURE_ACTION = "set_temperature"

Definition at line 75 of file light.py.

◆ CONF_TEMPERATURE_TEMPLATE

string homeassistant.components.template.light.CONF_TEMPERATURE_TEMPLATE = "temperature_template"

Definition at line 76 of file light.py.

◆ CONF_WHITE_VALUE_ACTION

string homeassistant.components.template.light.CONF_WHITE_VALUE_ACTION = "set_white_value"

Definition at line 77 of file light.py.

◆ CONF_WHITE_VALUE_TEMPLATE

string homeassistant.components.template.light.CONF_WHITE_VALUE_TEMPLATE = "white_value_template"

Definition at line 78 of file light.py.

◆ LIGHT_SCHEMA

homeassistant.components.template.light.LIGHT_SCHEMA

Definition at line 80 of file light.py.

◆ PLATFORM_SCHEMA

homeassistant.components.template.light.PLATFORM_SCHEMA
Initial value:
1 = vol.All(
2  # CONF_WHITE_VALUE_* is deprecated, support will be removed in release 2022.9
3  cv.removed(CONF_WHITE_VALUE_ACTION),
4  cv.removed(CONF_WHITE_VALUE_TEMPLATE),
5  LIGHT_PLATFORM_SCHEMA.extend(
6  {vol.Required(CONF_LIGHTS): cv.schema_with_slug_keys(LIGHT_SCHEMA)}
7  ),
8 )

Definition at line 114 of file light.py.