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

Public Member Functions

None __init__ (self, CustomerDevice device, Manager device_manager, TuyaLightEntityDescription description)
 
int|None brightness (self)
 
ColorMode color_mode (self)
 
int|None color_temp (self)
 
tuple[float, float]|None hs_color (self)
 
bool is_on (self)
 
None turn_off (self, **Any kwargs)
 
None turn_on (self, **Any kwargs)
 
- Public Member Functions inherited from homeassistant.components.tuya.entity.TuyaEntity
None __init__ (self, CustomerDevice device, Manager device_manager)
 
None async_added_to_hass (self)
 
bool available (self)
 
DeviceInfo device_info (self)
 
DPCode|None find_dpcode (self, str|DPCode|tuple[DPCode,...]|None dpcodes, *bool prefer_function=False)
 
DPCode|EnumTypeData|IntegerTypeData|None find_dpcode (self, str|DPCode|tuple[DPCode,...]|None dpcodes, *bool prefer_function=False, DPType|None dptype=None)
 
EnumTypeData|None find_dpcode (self, str|DPCode|tuple[DPCode,...]|None dpcodes, *bool prefer_function=False, Literal[DPType.ENUM] dptype)
 
IntegerTypeData|None find_dpcode (self, str|DPCode|tuple[DPCode,...]|None dpcodes, *bool prefer_function=False, Literal[DPType.INTEGER] dptype)
 
DPType|None get_dptype (self, DPCode|None dpcode, bool prefer_function=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)
 
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 max_mireds (self)
 
int min_color_temp_kelvin (self)
 
int min_mireds (self)
 
tuple[int, int, int]|None rgb_color (self)
 
tuple[int, int, int, int]|None rgbw_color (self)
 
tuple[int, int, int, int, int]|None rgbww_color (self)
 
dict[str, Any]|None state_attributes (self)
 
set[ColorMode]|set[str]|None supported_color_modes (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)
 
None async_turn_off (self, **Any kwargs)
 
None async_turn_on (self, **Any kwargs)
 
Literal["on", "off"]|None state (self)
 
None toggle (self, **Any kwargs)
 

Public Attributes

 color_mode
 
 entity_description
 
- Public Attributes inherited from homeassistant.components.tuya.entity.TuyaEntity
 device
 
 device_manager
 
- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Static Public Attributes

 None
 
- 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
 

Private Member Functions

ColorData|None _get_color_data (self)
 

Private Attributes

 _attr_supported_color_modes
 
 _attr_unique_id
 
 _brightness
 
 _brightness_max
 
 _brightness_min
 
 _color_data_dpcode
 
 _color_data_type
 
 _color_mode_dpcode
 
 _color_temp
 
 _fixed_color_mode
 

Detailed Description

Tuya light device.

Definition at line 447 of file light.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.tuya.light.TuyaLightEntity.__init__ (   self,
CustomerDevice  device,
Manager  device_manager,
TuyaLightEntityDescription  description 
)
Init TuyaHaLight.

Definition at line 461 of file light.py.

Member Function Documentation

◆ _get_color_data()

ColorData | None homeassistant.components.tuya.light.TuyaLightEntity._get_color_data (   self)
private
Get current color data from device.

Definition at line 732 of file light.py.

◆ brightness()

int | None homeassistant.components.tuya.light.TuyaLightEntity.brightness (   self)
Return the brightness of the light.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 651 of file light.py.

◆ color_mode()

ColorMode homeassistant.components.tuya.light.TuyaLightEntity.color_mode (   self)
Return the color_mode of the light.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 716 of file light.py.

◆ color_temp()

int | None homeassistant.components.tuya.light.TuyaLightEntity.color_temp (   self)
Return the color_temp of the light.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 691 of file light.py.

◆ hs_color()

tuple[float, float] | None homeassistant.components.tuya.light.TuyaLightEntity.hs_color (   self)
Return the hs_color of the light.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 707 of file light.py.

◆ is_on()

bool homeassistant.components.tuya.light.TuyaLightEntity.is_on (   self)
Return true if light is on.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 527 of file light.py.

◆ turn_off()

None homeassistant.components.tuya.light.TuyaLightEntity.turn_off (   self,
**Any  kwargs 
)
Instruct the light to turn off.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 646 of file light.py.

◆ turn_on()

None homeassistant.components.tuya.light.TuyaLightEntity.turn_on (   self,
**Any  kwargs 
)
Turn on or control the light.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 531 of file light.py.

Member Data Documentation

◆ _attr_supported_color_modes

homeassistant.components.tuya.light.TuyaLightEntity._attr_supported_color_modes
private

Definition at line 521 of file light.py.

◆ _attr_unique_id

homeassistant.components.tuya.light.TuyaLightEntity._attr_unique_id
private

Definition at line 470 of file light.py.

◆ _brightness

homeassistant.components.tuya.light.TuyaLightEntity._brightness
private

Definition at line 481 of file light.py.

◆ _brightness_max

homeassistant.components.tuya.light.TuyaLightEntity._brightness_max
private

Definition at line 483 of file light.py.

◆ _brightness_min

homeassistant.components.tuya.light.TuyaLightEntity._brightness_min
private

Definition at line 486 of file light.py.

◆ _color_data_dpcode

homeassistant.components.tuya.light.TuyaLightEntity._color_data_dpcode
private

Definition at line 499 of file light.py.

◆ _color_data_type

homeassistant.components.tuya.light.TuyaLightEntity._color_data_type
private

Definition at line 508 of file light.py.

◆ _color_mode_dpcode

homeassistant.components.tuya.light.TuyaLightEntity._color_mode_dpcode
private

Definition at line 474 of file light.py.

◆ _color_temp

homeassistant.components.tuya.light.TuyaLightEntity._color_temp
private

Definition at line 493 of file light.py.

◆ _fixed_color_mode

homeassistant.components.tuya.light.TuyaLightEntity._fixed_color_mode
private

Definition at line 524 of file light.py.

◆ color_mode

homeassistant.components.tuya.light.TuyaLightEntity.color_mode

Definition at line 562 of file light.py.

◆ entity_description

homeassistant.components.tuya.light.TuyaLightEntity.entity_description

Definition at line 469 of file light.py.

◆ None

homeassistant.components.tuya.light.TuyaLightEntity.None
static

Definition at line 452 of file light.py.


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