Namespaces | |
| device_action | |
| device_condition | |
| device_trigger | |
| intent | |
| reproduce_state | |
| significant_change | |
Classes | |
| class | ColorMode |
| class | LightEntity |
| class | LightEntityDescription |
| class | LightEntityFeature |
| class | Profile |
| class | Profiles |
Functions | |
| None | _coerce_none (str value) |
| bool | async_setup (HomeAssistant hass, ConfigType config) |
| bool | async_setup_entry (HomeAssistant hass, ConfigEntry entry) |
| bool | async_unload_entry (HomeAssistant hass, ConfigEntry entry) |
| bool | brightness_supported (Iterable[ColorMode|str]|None color_modes) |
| bool | color_supported (Iterable[ColorMode|str]|None color_modes) |
| bool | color_temp_supported (Iterable[ColorMode|str]|None color_modes) |
| set[ColorMode] | filter_supported_color_modes (Iterable[ColorMode] color_modes) |
| dict[str, Any] | filter_turn_off_params (LightEntity light, dict[str, Any] params) |
| dict[str, Any] | filter_turn_on_params (LightEntity light, dict[str, Any] params) |
| set[str]|None | get_supported_color_modes (HomeAssistant hass, str entity_id) |
| bool | is_on (HomeAssistant hass, str entity_id) |
| None | preprocess_turn_on_alternatives (HomeAssistant hass, dict[str, Any] params) |
| set[ColorMode|str] | valid_supported_color_modes (Iterable[ColorMode|str] color_modes) |
Variables | |
| _LOGGER = logging.getLogger(__name__) | |
| string | ATTR_BRIGHTNESS = "brightness" |
| string | ATTR_BRIGHTNESS_PCT = "brightness_pct" |
| string | ATTR_BRIGHTNESS_STEP = "brightness_step" |
| string | ATTR_BRIGHTNESS_STEP_PCT = "brightness_step_pct" |
| string | ATTR_COLOR_MODE = "color_mode" |
| string | ATTR_COLOR_NAME = "color_name" |
| string | ATTR_COLOR_TEMP = "color_temp" |
| string | ATTR_COLOR_TEMP_KELVIN = "color_temp_kelvin" |
| string | ATTR_EFFECT = "effect" |
| string | ATTR_EFFECT_LIST = "effect_list" |
| string | ATTR_FLASH = "flash" |
| string | ATTR_HS_COLOR = "hs_color" |
| string | ATTR_KELVIN = "kelvin" |
| string | ATTR_MAX_COLOR_TEMP_KELVIN = "max_color_temp_kelvin" |
| string | ATTR_MAX_MIREDS = "max_mireds" |
| string | ATTR_MIN_COLOR_TEMP_KELVIN = "min_color_temp_kelvin" |
| string | ATTR_MIN_MIREDS = "min_mireds" |
| string | ATTR_PROFILE = "profile" |
| string | ATTR_RGB_COLOR = "rgb_color" |
| string | ATTR_RGBW_COLOR = "rgbw_color" |
| string | ATTR_RGBWW_COLOR = "rgbww_color" |
| string | ATTR_SUPPORTED_COLOR_MODES = "supported_color_modes" |
| string | ATTR_TRANSITION = "transition" |
| string | ATTR_WHITE = "white" |
| string | ATTR_XY_COLOR = "xy_color" |
| dictionary | CACHED_PROPERTIES_WITH_ATTR_ |
| string | COLOR_GROUP = "Color descriptors" |
| string | COLOR_MODE_BRIGHTNESS = "brightness" |
| string | COLOR_MODE_COLOR_TEMP = "color_temp" |
| string | COLOR_MODE_HS = "hs" |
| string | COLOR_MODE_ONOFF = "onoff" |
| string | COLOR_MODE_RGB = "rgb" |
| string | COLOR_MODE_RGBW = "rgbw" |
| string | COLOR_MODE_RGBWW = "rgbww" |
| string | COLOR_MODE_UNKNOWN = "unknown" |
| string | COLOR_MODE_WHITE = "white" |
| string | COLOR_MODE_XY = "xy" |
| dictionary | COLOR_MODES_BRIGHTNESS = VALID_COLOR_MODES - {ColorMode.ONOFF} |
| dictionary | COLOR_MODES_COLOR |
| string | DOMAIN = "light" |
| string | EFFECT_COLORLOOP = "colorloop" |
| string | EFFECT_OFF = "off" |
| string | EFFECT_RANDOM = "random" |
| string | EFFECT_WHITE = "white" |
| string | ENTITY_ID_FORMAT = DOMAIN + ".{}" |
| string | FLASH_LONG = "long" |
| string | FLASH_SHORT = "short" |
| string | LIGHT_PROFILES_FILE = "light_profiles.csv" |
| PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA | |
| PLATFORM_SCHEMA_BASE = cv.PLATFORM_SCHEMA_BASE | |
| SCAN_INTERVAL = timedelta(seconds=30) | |
| int | SUPPORT_BRIGHTNESS = 1 |
| int | SUPPORT_COLOR = 16 |
| int | SUPPORT_COLOR_TEMP = 2 |
| int | SUPPORT_EFFECT = 4 |
| int | SUPPORT_FLASH = 8 |
| int | SUPPORT_TRANSITION = 32 |
| VALID_BRIGHTNESS = vol.All(vol.Coerce(int), vol.Clamp(min=0, max=255)) | |
| VALID_BRIGHTNESS_PCT = vol.All(vol.Coerce(float), vol.Range(min=0, max=100)) | |
| VALID_BRIGHTNESS_STEP = vol.All(vol.Coerce(int), vol.Clamp(min=-255, max=255)) | |
| VALID_BRIGHTNESS_STEP_PCT = vol.All(vol.Coerce(float), vol.Clamp(min=-100, max=100)) | |
| dictionary | VALID_COLOR_MODES |
| VALID_FLASH = vol.In([FLASH_SHORT, FLASH_LONG]) | |
| VALID_TRANSITION = vol.All(vol.Coerce(float), vol.Clamp(min=0, max=6553)) | |
| VolDictType | |
Provides functionality to interact with lights.
|
private |
Coerce an empty string as None.
Definition at line 683 of file __init__.py.
| bool homeassistant.components.light.async_setup | ( | HomeAssistant | hass, |
| ConfigType | config | ||
| ) |
Expose light control via state machine and services.
Definition at line 396 of file __init__.py.
| bool homeassistant.components.light.async_setup_entry | ( | HomeAssistant | hass, |
| ConfigEntry | entry | ||
| ) |
Set up a config entry.
Definition at line 673 of file __init__.py.
| bool homeassistant.components.light.async_unload_entry | ( | HomeAssistant | hass, |
| ConfigEntry | entry | ||
| ) |
Unload a config entry.
Definition at line 678 of file __init__.py.
| bool homeassistant.components.light.brightness_supported | ( | Iterable[ColorMode | str] | None | color_modes | ) |
Test if brightness is supported.
Definition at line 155 of file __init__.py.
| bool homeassistant.components.light.color_supported | ( | Iterable[ColorMode | str] | None | color_modes | ) |
Test if color is supported.
Definition at line 162 of file __init__.py.
| bool homeassistant.components.light.color_temp_supported | ( | Iterable[ColorMode | str] | None | color_modes | ) |
Test if color temperature is supported.
Definition at line 169 of file __init__.py.
| set[ColorMode] homeassistant.components.light.filter_supported_color_modes | ( | Iterable[ColorMode] | color_modes | ) |
Filter the given color modes.
Definition at line 122 of file __init__.py.
| dict[str, Any] homeassistant.components.light.filter_turn_off_params | ( | LightEntity | light, |
| dict[str, Any] | params | ||
| ) |
Filter out params not used in turn off or not supported by the light.
Definition at line 344 of file __init__.py.
| dict[str, Any] homeassistant.components.light.filter_turn_on_params | ( | LightEntity | light, |
| dict[str, Any] | params | ||
| ) |
Filter out params not supported by the light.
Definition at line 361 of file __init__.py.
| set[str] | None homeassistant.components.light.get_supported_color_modes | ( | HomeAssistant | hass, |
| str | entity_id | ||
| ) |
Get supported color modes for a light entity. First try the statemachine, then entity registry. This is the equivalent of entity helper get_supported_features.
Definition at line 176 of file __init__.py.
| bool homeassistant.components.light.is_on | ( | HomeAssistant | hass, |
| str | entity_id | ||
| ) |
Return if the lights are on based on the statemachine.
Definition at line 298 of file __init__.py.
| None homeassistant.components.light.preprocess_turn_on_alternatives | ( | HomeAssistant | hass, |
| dict[str, Any] | params | ||
| ) |
Process extra data for turn light on request. Async friendly.
Definition at line 303 of file __init__.py.
| set[ColorMode | str] homeassistant.components.light.valid_supported_color_modes | ( | Iterable[ColorMode | str] | color_modes | ) |
Validate the given color modes.
Definition at line 139 of file __init__.py.
|
private |
Definition at line 294 of file __init__.py.
| string homeassistant.components.light.ATTR_BRIGHTNESS = "brightness" |
Definition at line 214 of file __init__.py.
| string homeassistant.components.light.ATTR_BRIGHTNESS_PCT = "brightness_pct" |
Definition at line 215 of file __init__.py.
| string homeassistant.components.light.ATTR_BRIGHTNESS_STEP = "brightness_step" |
Definition at line 216 of file __init__.py.
| string homeassistant.components.light.ATTR_BRIGHTNESS_STEP_PCT = "brightness_step_pct" |
Definition at line 217 of file __init__.py.
| string homeassistant.components.light.ATTR_COLOR_MODE = "color_mode" |
Definition at line 62 of file __init__.py.
| string homeassistant.components.light.ATTR_COLOR_NAME = "color_name" |
Definition at line 210 of file __init__.py.
| string homeassistant.components.light.ATTR_COLOR_TEMP = "color_temp" |
Definition at line 203 of file __init__.py.
| string homeassistant.components.light.ATTR_COLOR_TEMP_KELVIN = "color_temp_kelvin" |
Definition at line 207 of file __init__.py.
| string homeassistant.components.light.ATTR_EFFECT = "effect" |
Definition at line 231 of file __init__.py.
| string homeassistant.components.light.ATTR_EFFECT_LIST = "effect_list" |
Definition at line 228 of file __init__.py.
| string homeassistant.components.light.ATTR_FLASH = "flash" |
Definition at line 223 of file __init__.py.
| string homeassistant.components.light.ATTR_HS_COLOR = "hs_color" |
Definition at line 202 of file __init__.py.
| string homeassistant.components.light.ATTR_KELVIN = "kelvin" |
Definition at line 204 of file __init__.py.
| string homeassistant.components.light.ATTR_MAX_COLOR_TEMP_KELVIN = "max_color_temp_kelvin" |
Definition at line 209 of file __init__.py.
| string homeassistant.components.light.ATTR_MAX_MIREDS = "max_mireds" |
Definition at line 206 of file __init__.py.
| string homeassistant.components.light.ATTR_MIN_COLOR_TEMP_KELVIN = "min_color_temp_kelvin" |
Definition at line 208 of file __init__.py.
| string homeassistant.components.light.ATTR_MIN_MIREDS = "min_mireds" |
Definition at line 205 of file __init__.py.
| string homeassistant.components.light.ATTR_PROFILE = "profile" |
Definition at line 220 of file __init__.py.
| string homeassistant.components.light.ATTR_RGB_COLOR = "rgb_color" |
Definition at line 198 of file __init__.py.
| string homeassistant.components.light.ATTR_RGBW_COLOR = "rgbw_color" |
Definition at line 199 of file __init__.py.
| string homeassistant.components.light.ATTR_RGBWW_COLOR = "rgbww_color" |
Definition at line 200 of file __init__.py.
| string homeassistant.components.light.ATTR_SUPPORTED_COLOR_MODES = "supported_color_modes" |
Definition at line 64 of file __init__.py.
| string homeassistant.components.light.ATTR_TRANSITION = "transition" |
Definition at line 195 of file __init__.py.
| string homeassistant.components.light.ATTR_WHITE = "white" |
Definition at line 211 of file __init__.py.
| string homeassistant.components.light.ATTR_XY_COLOR = "xy_color" |
Definition at line 201 of file __init__.py.
| dictionary homeassistant.components.light.CACHED_PROPERTIES_WITH_ATTR_ |
Definition at line 838 of file __init__.py.
| string homeassistant.components.light.COLOR_GROUP = "Color descriptors" |
Definition at line 237 of file __init__.py.
| string homeassistant.components.light.COLOR_MODE_BRIGHTNESS = "brightness" |
Definition at line 90 of file __init__.py.
| string homeassistant.components.light.COLOR_MODE_COLOR_TEMP = "color_temp" |
Definition at line 91 of file __init__.py.
| string homeassistant.components.light.COLOR_MODE_HS = "hs" |
Definition at line 92 of file __init__.py.
| string homeassistant.components.light.COLOR_MODE_ONOFF = "onoff" |
Definition at line 89 of file __init__.py.
| string homeassistant.components.light.COLOR_MODE_RGB = "rgb" |
Definition at line 94 of file __init__.py.
| string homeassistant.components.light.COLOR_MODE_RGBW = "rgbw" |
Definition at line 95 of file __init__.py.
| string homeassistant.components.light.COLOR_MODE_RGBWW = "rgbww" |
Definition at line 96 of file __init__.py.
| string homeassistant.components.light.COLOR_MODE_UNKNOWN = "unknown" |
Definition at line 88 of file __init__.py.
| string homeassistant.components.light.COLOR_MODE_WHITE = "white" |
Definition at line 97 of file __init__.py.
| string homeassistant.components.light.COLOR_MODE_XY = "xy" |
Definition at line 93 of file __init__.py.
| dictionary homeassistant.components.light.COLOR_MODES_BRIGHTNESS = VALID_COLOR_MODES - {ColorMode.ONOFF} |
Definition at line 110 of file __init__.py.
| dictionary homeassistant.components.light.COLOR_MODES_COLOR |
Definition at line 111 of file __init__.py.
| string homeassistant.components.light.DOMAIN = "light" |
Definition at line 34 of file __init__.py.
| string homeassistant.components.light.EFFECT_COLORLOOP = "colorloop" |
Definition at line 232 of file __init__.py.
| string homeassistant.components.light.EFFECT_OFF = "off" |
Definition at line 233 of file __init__.py.
| string homeassistant.components.light.EFFECT_RANDOM = "random" |
Definition at line 234 of file __init__.py.
| string homeassistant.components.light.EFFECT_WHITE = "white" |
Definition at line 235 of file __init__.py.
| string homeassistant.components.light.ENTITY_ID_FORMAT = DOMAIN + ".{}" |
Definition at line 36 of file __init__.py.
| string homeassistant.components.light.FLASH_LONG = "long" |
Definition at line 225 of file __init__.py.
| string homeassistant.components.light.FLASH_SHORT = "short" |
Definition at line 224 of file __init__.py.
| string homeassistant.components.light.LIGHT_PROFILES_FILE = "light_profiles.csv" |
Definition at line 239 of file __init__.py.
| homeassistant.components.light.PLATFORM_SCHEMA = cv.PLATFORM_SCHEMA |
Definition at line 37 of file __init__.py.
| homeassistant.components.light.PLATFORM_SCHEMA_BASE = cv.PLATFORM_SCHEMA_BASE |
Definition at line 38 of file __init__.py.
| homeassistant.components.light.SCAN_INTERVAL = timedelta(seconds=30) |
Definition at line 39 of file __init__.py.
| int homeassistant.components.light.SUPPORT_BRIGHTNESS = 1 |
Definition at line 54 of file __init__.py.
| int homeassistant.components.light.SUPPORT_COLOR = 16 |
Definition at line 58 of file __init__.py.
| int homeassistant.components.light.SUPPORT_COLOR_TEMP = 2 |
Definition at line 55 of file __init__.py.
| int homeassistant.components.light.SUPPORT_EFFECT = 4 |
Definition at line 56 of file __init__.py.
| int homeassistant.components.light.SUPPORT_FLASH = 8 |
Definition at line 57 of file __init__.py.
| int homeassistant.components.light.SUPPORT_TRANSITION = 32 |
Definition at line 59 of file __init__.py.
| homeassistant.components.light.VALID_BRIGHTNESS = vol.All(vol.Coerce(int), vol.Clamp(min=0, max=255)) |
Definition at line 243 of file __init__.py.
| homeassistant.components.light.VALID_BRIGHTNESS_PCT = vol.All(vol.Coerce(float), vol.Range(min=0, max=100)) |
Definition at line 244 of file __init__.py.
| homeassistant.components.light.VALID_BRIGHTNESS_STEP = vol.All(vol.Coerce(int), vol.Clamp(min=-255, max=255)) |
Definition at line 245 of file __init__.py.
| homeassistant.components.light.VALID_BRIGHTNESS_STEP_PCT = vol.All(vol.Coerce(float), vol.Clamp(min=-100, max=100)) |
Definition at line 246 of file __init__.py.
| dictionary homeassistant.components.light.VALID_COLOR_MODES |
Definition at line 99 of file __init__.py.
| homeassistant.components.light.VALID_FLASH = vol.In([FLASH_SHORT, FLASH_LONG]) |
Definition at line 247 of file __init__.py.
| homeassistant.components.light.VALID_TRANSITION = vol.All(vol.Coerce(float), vol.Clamp(min=0, max=6553)) |
Definition at line 242 of file __init__.py.
| homeassistant.components.light.VolDictType |
Definition at line 249 of file __init__.py.