Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.zwave_js.light.ZwaveLight Class Reference
Inheritance diagram for homeassistant.components.zwave_js.light.ZwaveLight:
[legend]
Collaboration diagram for homeassistant.components.zwave_js.light.ZwaveLight:
[legend]

Public Member Functions

None __init__ (self, ConfigEntry config_entry, Driver driver, ZwaveDiscoveryInfo info)
 
None async_turn_off (self, **Any kwargs)
 
None async_turn_on (self, **Any kwargs)
 
int|None brightness (self)
 
str|None color_mode (self)
 
int|None color_temp (self)
 
tuple[float, float]|None hs_color (self)
 
bool|None is_on (self)
 
int max_mireds (self)
 
int min_mireds (self)
 
None on_value_update (self)
 
tuple[int, int, int, int]|None rgbw_color (self)
 
set[ColorMode]|None supported_color_modes (self)
 
- Public Member Functions inherited from homeassistant.components.zwave_js.entity.ZWaveBaseEntity
None async_added_to_hass (self)
 
None async_poll_value (self, bool refresh_all_values)
 
bool available (self)
 
str generate_name (self, bool include_value_name=False, str|None alternate_value_name=None, Sequence[str|None]|None additional_info=None, str|None name_prefix=None)
 
ZwaveValue|None get_zwave_value (self, str|int value_property, int|None command_class=None, int|None endpoint=None, int|str|None value_property_key=None, bool add_to_watched_value_ids=True, bool check_all_endpoints=False)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (self)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
None add_to_platform_start (self, HomeAssistant hass, EntityPlatform platform, asyncio.Semaphore|None parallel_updates)
 
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_removed_from_registry (self)
 
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_will_remove_from_hass (self)
 
None async_write_ha_state (self)
 
str|None attribution (self)
 
str|None device_class (self)
 
DeviceInfo|None device_info (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.light.LightEntity
dict[str, Any] capability_attributes (self)
 
int|None color_temp_kelvin (self)
 
str|None effect (self)
 
list[str]|None effect_list (self)
 
int max_color_temp_kelvin (self)
 
int min_color_temp_kelvin (self)
 
tuple[int, int, int]|None rgb_color (self)
 
tuple[int, int, int, int, int]|None rgbww_color (self)
 
dict[str, Any]|None state_attributes (self)
 
LightEntityFeature supported_features (self)
 
LightEntityFeature supported_features_compat (self)
 
tuple[float, float]|None xy_color (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.ToggleEntity
None async_toggle (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)
 

Public Attributes

 supported_color_modes
 
 supports_brightness_transition
 
 supports_color_transition
 
- Public Attributes inherited from homeassistant.components.zwave_js.entity.ZWaveBaseEntity
 config_entry
 
 driver
 
 info
 
 watched_value_ids
 
- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Private Member Functions

None _async_set_brightness (self, int|None brightness, float|None transition=None)
 
None _async_set_colors (self, dict[ColorComponent, int] colors, float|None transition=None)
 
None _calculate_color_support (self)
 
None _calculate_color_values (self)
 
tuple[Value|None,...] _get_color_values (self)
 
dict[ColorComponent, int]|None _get_new_colors (self, tuple[float, float]|None hs_color, int|None color_temp, tuple[int, int, int, int]|None rgbw, float|None brightness_scale=None)
 

Private Attributes

 _attr_name
 
 _cold_white
 
 _color_mode
 
 _color_temp
 
 _current_color
 
 _hs_color
 
 _max_mireds
 
 _min_mireds
 
 _rgbw_color
 
 _set_optimistic_state
 
 _supports_color
 
 _supports_color_temp
 
 _supports_dimming
 
 _supports_rgbw
 
 _target_brightness
 
 _target_color
 
 _warm_white
 

Additional Inherited Members

- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 
- Static Public Attributes inherited from homeassistant.components.light.LightEntity
 int
 
 LightEntityFeature
 
 None
 
- Static Public Attributes inherited from homeassistant.helpers.entity.ToggleEntity
 None
 

Detailed Description

Representation of a Z-Wave light.

Definition at line 103 of file light.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.zwave_js.light.ZwaveLight.__init__ (   self,
ConfigEntry  config_entry,
Driver  driver,
ZwaveDiscoveryInfo   info 
)
Initialize the light.

Reimplemented from homeassistant.components.zwave_js.entity.ZWaveBaseEntity.

Reimplemented in homeassistant.components.zwave_js.light.ZwaveColorOnOffLight.

Definition at line 106 of file light.py.

Member Function Documentation

◆ _async_set_brightness()

None homeassistant.components.zwave_js.light.ZwaveLight._async_set_brightness (   self,
int | None  brightness,
float | None   transition = None 
)
private
Set new brightness to light.

Definition at line 386 of file light.py.

◆ _async_set_colors()

None homeassistant.components.zwave_js.light.ZwaveLight._async_set_colors (   self,
dict[ColorComponent, int colors,
float | None   transition = None 
)
private
Set (multiple) defined colors to given value(s).

Definition at line 354 of file light.py.

◆ _calculate_color_support()

None homeassistant.components.zwave_js.light.ZwaveLight._calculate_color_support (   self)
private
Calculate light colors.

Definition at line 461 of file light.py.

◆ _calculate_color_values()

None homeassistant.components.zwave_js.light.ZwaveLight._calculate_color_values (   self)
private
Calculate light colors.

Definition at line 475 of file light.py.

◆ _get_color_values()

tuple[Value | None, ...] homeassistant.components.zwave_js.light.ZwaveLight._get_color_values (   self)
private
Get light colors.

Definition at line 428 of file light.py.

◆ _get_new_colors()

dict[ColorComponent, int] | None homeassistant.components.zwave_js.light.ZwaveLight._get_new_colors (   self,
tuple[float, float] | None  hs_color,
int | None  color_temp,
tuple[int, int, int, int] | None  rgbw,
float | None   brightness_scale = None 
)
private
Determine the new color dict to set.

Definition at line 284 of file light.py.

◆ async_turn_off()

None homeassistant.components.zwave_js.light.ZwaveLight.async_turn_off (   self,
**Any  kwargs 
)
Turn the light off.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Reimplemented in homeassistant.components.zwave_js.light.ZwaveColorOnOffLight.

Definition at line 280 of file light.py.

◆ async_turn_on()

None homeassistant.components.zwave_js.light.ZwaveLight.async_turn_on (   self,
**Any  kwargs 
)
Turn the device on.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Reimplemented in homeassistant.components.zwave_js.light.ZwaveColorOnOffLight.

Definition at line 263 of file light.py.

◆ brightness()

int | None homeassistant.components.zwave_js.light.ZwaveLight.brightness (   self)
Return the brightness of this light between 0..255.

Z-Wave multilevel switches use a range of [0, 99] to control brightness.

Reimplemented from homeassistant.components.light.LightEntity.

Reimplemented in homeassistant.components.zwave_js.light.ZwaveColorOnOffLight.

Definition at line 210 of file light.py.

◆ color_mode()

str | None homeassistant.components.zwave_js.light.ZwaveLight.color_mode (   self)
Return the color mode of the light.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 220 of file light.py.

◆ color_temp()

int | None homeassistant.components.zwave_js.light.ZwaveLight.color_temp (   self)
Return the color temperature.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 244 of file light.py.

◆ hs_color()

tuple[float, float] | None homeassistant.components.zwave_js.light.ZwaveLight.hs_color (   self)
Return the hs color.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 234 of file light.py.

◆ is_on()

bool | None homeassistant.components.zwave_js.light.ZwaveLight.is_on (   self)
Return true if device is on (brightness above 0).

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 225 of file light.py.

◆ max_mireds()

int homeassistant.components.zwave_js.light.ZwaveLight.max_mireds (   self)
Return the warmest color_temp that this light supports.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 254 of file light.py.

◆ min_mireds()

int homeassistant.components.zwave_js.light.ZwaveLight.min_mireds (   self)
Return the coldest color_temp that this light supports.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 249 of file light.py.

◆ on_value_update()

None homeassistant.components.zwave_js.light.ZwaveLight.on_value_update (   self)
Call when a watched value is added or updated.

Reimplemented from homeassistant.components.zwave_js.entity.ZWaveBaseEntity.

Definition at line 205 of file light.py.

◆ rgbw_color()

tuple[int, int, int, int] | None homeassistant.components.zwave_js.light.ZwaveLight.rgbw_color (   self)
Return the RGBW color.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 239 of file light.py.

◆ supported_color_modes()

set[ColorMode] | None homeassistant.components.zwave_js.light.ZwaveLight.supported_color_modes (   self)
Flag supported features.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 259 of file light.py.

Member Data Documentation

◆ _attr_name

homeassistant.components.zwave_js.light.ZwaveLight._attr_name
private

Definition at line 155 of file light.py.

◆ _cold_white

homeassistant.components.zwave_js.light.ZwaveLight._cold_white
private

Definition at line 126 of file light.py.

◆ _color_mode

homeassistant.components.zwave_js.light.ZwaveLight._color_mode
private

Definition at line 486 of file light.py.

◆ _color_temp

homeassistant.components.zwave_js.light.ZwaveLight._color_temp
private

Definition at line 508 of file light.py.

◆ _current_color

homeassistant.components.zwave_js.light.ZwaveLight._current_color
private

Definition at line 165 of file light.py.

◆ _hs_color

homeassistant.components.zwave_js.light.ZwaveLight._hs_color
private

Definition at line 498 of file light.py.

◆ _max_mireds

homeassistant.components.zwave_js.light.ZwaveLight._max_mireds
private

Definition at line 120 of file light.py.

◆ _min_mireds

homeassistant.components.zwave_js.light.ZwaveLight._min_mireds
private

Definition at line 119 of file light.py.

◆ _rgbw_color

homeassistant.components.zwave_js.light.ZwaveLight._rgbw_color
private

Definition at line 519 of file light.py.

◆ _set_optimistic_state

homeassistant.components.zwave_js.light.ZwaveLight._set_optimistic_state
private

Definition at line 228 of file light.py.

◆ _supports_color

homeassistant.components.zwave_js.light.ZwaveLight._supports_color
private

Definition at line 111 of file light.py.

◆ _supports_color_temp

homeassistant.components.zwave_js.light.ZwaveLight._supports_color_temp
private

Definition at line 113 of file light.py.

◆ _supports_dimming

homeassistant.components.zwave_js.light.ZwaveLight._supports_dimming
private

Definition at line 114 of file light.py.

◆ _supports_rgbw

homeassistant.components.zwave_js.light.ZwaveLight._supports_rgbw
private

Definition at line 112 of file light.py.

◆ _target_brightness

homeassistant.components.zwave_js.light.ZwaveLight._target_brightness
private

Definition at line 138 of file light.py.

◆ _target_color

homeassistant.components.zwave_js.light.ZwaveLight._target_color
private

Definition at line 170 of file light.py.

◆ _warm_white

homeassistant.components.zwave_js.light.ZwaveLight._warm_white
private

Definition at line 121 of file light.py.

◆ supported_color_modes

homeassistant.components.zwave_js.light.ZwaveLight.supported_color_modes

Definition at line 485 of file light.py.

◆ supports_brightness_transition

homeassistant.components.zwave_js.light.ZwaveLight.supports_brightness_transition

Definition at line 188 of file light.py.

◆ supports_color_transition

homeassistant.components.zwave_js.light.ZwaveLight.supports_color_transition

Definition at line 193 of file light.py.


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