Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.mqtt.light.schema_basic.MqttLight Class Reference
Inheritance diagram for homeassistant.components.mqtt.light.schema_basic.MqttLight:
[legend]
Collaboration diagram for homeassistant.components.mqtt.light.schema_basic.MqttLight:
[legend]

Public Member Functions

None async_turn_off (self, **Any kwargs)
 
None async_turn_on (self, **Any kwargs)
 
- Public Member Functions inherited from homeassistant.components.mqtt.entity.MqttEntity
None __init__ (self, HomeAssistant hass, ConfigType config, ConfigEntry config_entry, DiscoveryInfoType|None discovery_data)
 
bool add_subscription (self, str state_topic_config_key, Callable[[ReceiveMessage], None] msg_callback, set[str]|None tracked_attributes, bool disable_encoding=False)
 
None async_added_to_hass (self)
 
None async_publish (self, str topic, PublishPayloadType payload, int qos=0, bool retain=False, str|None encoding=DEFAULT_ENCODING)
 
None async_publish_with_config (self, str topic, PublishPayloadType payload)
 
None async_will_remove_from_hass (self)
 
None discovery_update (self, MQTTDiscoveryPayload discovery_payload)
 
None mqtt_async_added_to_hass (self)
 
- Public Member Functions inherited from homeassistant.components.mqtt.entity.MqttAttributesMixin
None __init__ (self, ConfigType config)
 
None attributes_discovery_update (self, DiscoveryInfoType config)
 
None attributes_prepare_discovery_update (self, DiscoveryInfoType config)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (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_on_remove (self, CALLBACK_TYPE func)
 
None async_registry_entry_updated (self)
 
None async_remove (self, *bool force_remove=False)
 
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_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.mqtt.entity.MqttAvailabilityMixin
None __init__ (self, ConfigType config)
 
None async_mqtt_connection_state_changed (self, bool state)
 
None availability_discovery_update (self, DiscoveryInfoType config)
 
None availability_prepare_discovery_update (self, DiscoveryInfoType config)
 
bool available (self)
 
- Public Member Functions inherited from homeassistant.components.mqtt.entity.MqttDiscoveryUpdateMixin
None __init__ (self, HomeAssistant hass, DiscoveryInfoType|None discovery_data, Callable[[MQTTDiscoveryPayload], Coroutine[Any, Any, None]]|None discovery_update=None)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
None async_removed_from_registry (self)
 
- Public Member Functions inherited from homeassistant.components.mqtt.entity.MqttEntityDeviceInfo
None __init__ (self, dict[str, Any]|None specifications, ConfigEntry config_entry)
 
DeviceInfo|None device_info (self)
 
None device_info_discovery_update (self, DiscoveryInfoType config)
 
- Public Member Functions inherited from homeassistant.components.light.LightEntity
int|None brightness (self)
 
dict[str, Any] capability_attributes (self)
 
ColorMode|str|None color_mode (self)
 
int|None color_temp (self)
 
int|None color_temp_kelvin (self)
 
str|None effect (self)
 
list[str]|None effect_list (self)
 
tuple[float, float]|None hs_color (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)
 
bool|None is_on (self)
 
Literal["on", "off"]|None state (self)
 
None toggle (self, **Any kwargs)
 
None turn_off (self, **Any kwargs)
 
None turn_on (self, **Any kwargs)
 
- Public Member Functions inherited from homeassistant.helpers.restore_state.RestoreEntity
ExtraStoredData|None async_get_last_extra_data (self)
 
State|None async_get_last_state (self)
 
None async_internal_added_to_hass (self)
 
None async_internal_will_remove_from_hass (self)
 
ExtraStoredData|None extra_restore_state_data (self)
 

Static Public Member Functions

VolSchemaType config_schema ()
 

Private Member Functions

None _brightness_received (self, ReceiveMessage msg)
 
None _color_mode_received (self, ReceiveMessage msg)
 
None _color_temp_received (self, ReceiveMessage msg)
 
None _effect_received (self, ReceiveMessage msg)
 
None _hs_received (self, ReceiveMessage msg)
 
bool _is_optimistic (self, str attribute)
 
None _prepare_subscribe_topics (self)
 
None _rgb_received (self, ReceiveMessage msg)
 
None _rgbw_received (self, ReceiveMessage msg)
 
None _rgbww_received (self, ReceiveMessage msg)
 
tuple[int,...]|None _rgbx_received (self, ReceiveMessage msg, str template, ColorMode color_mode, Callable[..., tuple[int,...]] convert_color)
 
None _setup_from_config (self, ConfigType config)
 
None _state_received (self, ReceiveMessage msg)
 
None _subscribe_topics (self)
 
None _xy_received (self, ReceiveMessage msg)
 

Private Attributes

 _attr_assumed_state
 
 _attr_brightness
 
 _attr_color_mode
 
 _attr_color_temp
 
 _attr_effect
 
 _attr_effect_list
 
 _attr_hs_color
 
 _attr_is_on
 
 _attr_max_mireds
 
 _attr_min_mireds
 
 _attr_rgb_color
 
 _attr_rgbw_color
 
 _attr_rgbww_color
 
 _attr_supported_color_modes
 
 _attr_supported_features
 
 _attr_xy_color
 
 _command_templates
 
 _optimistic
 
 _optimistic_brightness
 
 _optimistic_color_mode
 
 _optimistic_color_temp
 
 _optimistic_effect
 
 _optimistic_hs_color
 
 _optimistic_rgb_color
 
 _optimistic_rgbw_color
 
 _optimistic_rgbww_color
 
 _optimistic_xy_color
 
 _payload
 
 _topic
 
 _value_templates
 

Static Private Attributes

 _attributes_extra_blocked = MQTT_LIGHT_ATTRIBUTES_BLOCKED
 
 _default_name = DEFAULT_NAME
 
 _entity_id_format = ENTITY_ID_FORMAT
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.components.mqtt.entity.MqttEntity
 hass
 
- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 
- Static Public Attributes inherited from homeassistant.components.mqtt.entity.MqttAttributesMixin
 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
 

Detailed Description

Representation of a MQTT light.

Definition at line 226 of file schema_basic.py.

Member Function Documentation

◆ _brightness_received()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._brightness_received (   self,
ReceiveMessage  msg 
)
private
Handle new MQTT messages for the brightness.

Definition at line 394 of file schema_basic.py.

◆ _color_mode_received()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._color_mode_received (   self,
ReceiveMessage  msg 
)
private
Handle new MQTT messages for color mode.

Definition at line 492 of file schema_basic.py.

◆ _color_temp_received()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._color_temp_received (   self,
ReceiveMessage  msg 
)
private
Handle new MQTT messages for color temperature.

Definition at line 504 of file schema_basic.py.

◆ _effect_received()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._effect_received (   self,
ReceiveMessage  msg 
)
private
Handle new MQTT messages for effect.

Definition at line 518 of file schema_basic.py.

◆ _hs_received()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._hs_received (   self,
ReceiveMessage  msg 
)
private
Handle new MQTT messages for hs color.

Definition at line 530 of file schema_basic.py.

◆ _is_optimistic()

bool homeassistant.components.mqtt.light.schema_basic.MqttLight._is_optimistic (   self,
str  attribute 
)
private
Return True if the attribute is optimistically updated.

Definition at line 371 of file schema_basic.py.

◆ _prepare_subscribe_topics()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._prepare_subscribe_topics (   self)
private
(Re)Subscribe to topics.

Reimplemented from homeassistant.components.mqtt.entity.MqttEntity.

Definition at line 562 of file schema_basic.py.

◆ _rgb_received()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._rgb_received (   self,
ReceiveMessage  msg 
)
private
Handle new MQTT messages for RGB.

Definition at line 445 of file schema_basic.py.

◆ _rgbw_received()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._rgbw_received (   self,
ReceiveMessage  msg 
)
private
Handle new MQTT messages for RGBW.

Definition at line 455 of file schema_basic.py.

◆ _rgbww_received()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._rgbww_received (   self,
ReceiveMessage  msg 
)
private
Handle new MQTT messages for RGBWW.

Definition at line 468 of file schema_basic.py.

◆ _rgbx_received()

tuple[int, ...] | None homeassistant.components.mqtt.light.schema_basic.MqttLight._rgbx_received (   self,
ReceiveMessage  msg,
str  template,
ColorMode  color_mode,
Callable[..., tuple[int, ...]]  convert_color 
)
private
Process MQTT messages for RGBW and RGBWW.

Definition at line 412 of file schema_basic.py.

◆ _setup_from_config()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._setup_from_config (   self,
ConfigType  config 
)
private
(Re)Setup the entity.

Reimplemented from homeassistant.components.mqtt.entity.MqttEntity.

Definition at line 256 of file schema_basic.py.

◆ _state_received()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._state_received (   self,
ReceiveMessage  msg 
)
private
Handle new MQTT messages.

Definition at line 377 of file schema_basic.py.

◆ _subscribe_topics()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._subscribe_topics (   self)
private
(Re)Subscribe to topics.

Reimplemented from homeassistant.components.mqtt.entity.MqttEntity.

Definition at line 605 of file schema_basic.py.

◆ _xy_received()

None homeassistant.components.mqtt.light.schema_basic.MqttLight._xy_received (   self,
ReceiveMessage  msg 
)
private
Handle new MQTT messages for xy color.

Definition at line 547 of file schema_basic.py.

◆ async_turn_off()

None homeassistant.components.mqtt.light.schema_basic.MqttLight.async_turn_off (   self,
**Any  kwargs 
)
Turn the device off.

This method is a coroutine.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 844 of file schema_basic.py.

◆ async_turn_on()

None homeassistant.components.mqtt.light.schema_basic.MqttLight.async_turn_on (   self,
**Any  kwargs 
)
Turn the device on.

This method is a coroutine.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 634 of file schema_basic.py.

◆ config_schema()

VolSchemaType homeassistant.components.mqtt.light.schema_basic.MqttLight.config_schema ( )
static
Return the config schema.

Reimplemented from homeassistant.components.mqtt.entity.MqttEntity.

Definition at line 252 of file schema_basic.py.

Member Data Documentation

◆ _attr_assumed_state

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_assumed_state
private

Definition at line 307 of file schema_basic.py.

◆ _attr_brightness

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_brightness
private

Definition at line 409 of file schema_basic.py.

◆ _attr_color_mode

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_color_mode
private

Definition at line 333 of file schema_basic.py.

◆ _attr_color_temp

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_color_temp
private

Definition at line 515 of file schema_basic.py.

◆ _attr_effect

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_effect
private

Definition at line 527 of file schema_basic.py.

◆ _attr_effect_list

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_effect_list
private

Definition at line 260 of file schema_basic.py.

◆ _attr_hs_color

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_hs_color
private

Definition at line 542 of file schema_basic.py.

◆ _attr_is_on

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_is_on
private

Definition at line 387 of file schema_basic.py.

◆ _attr_max_mireds

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_max_mireds
private

Definition at line 259 of file schema_basic.py.

◆ _attr_min_mireds

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_min_mireds
private

Definition at line 258 of file schema_basic.py.

◆ _attr_rgb_color

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_rgb_color
private

Definition at line 452 of file schema_basic.py.

◆ _attr_rgbw_color

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_rgbw_color
private

Definition at line 465 of file schema_basic.py.

◆ _attr_rgbww_color

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_rgbww_color
private

Definition at line 489 of file schema_basic.py.

◆ _attr_supported_color_modes

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_supported_color_modes
private

Definition at line 363 of file schema_basic.py.

◆ _attr_supported_features

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_supported_features
private

Definition at line 367 of file schema_basic.py.

◆ _attr_xy_color

homeassistant.components.mqtt.light.schema_basic.MqttLight._attr_xy_color
private

Definition at line 559 of file schema_basic.py.

◆ _attributes_extra_blocked

homeassistant.components.mqtt.light.schema_basic.MqttLight._attributes_extra_blocked = MQTT_LIGHT_ATTRIBUTES_BLOCKED
staticprivate

Definition at line 231 of file schema_basic.py.

◆ _command_templates

homeassistant.components.mqtt.light.schema_basic.MqttLight._command_templates
private

Definition at line 297 of file schema_basic.py.

◆ _default_name

homeassistant.components.mqtt.light.schema_basic.MqttLight._default_name = DEFAULT_NAME
staticprivate

Definition at line 229 of file schema_basic.py.

◆ _entity_id_format

homeassistant.components.mqtt.light.schema_basic.MqttLight._entity_id_format = ENTITY_ID_FORMAT
staticprivate

Definition at line 230 of file schema_basic.py.

◆ _optimistic

homeassistant.components.mqtt.light.schema_basic.MqttLight._optimistic
private

Definition at line 306 of file schema_basic.py.

◆ _optimistic_brightness

homeassistant.components.mqtt.light.schema_basic.MqttLight._optimistic_brightness
private

Definition at line 313 of file schema_basic.py.

◆ _optimistic_color_mode

homeassistant.components.mqtt.light.schema_basic.MqttLight._optimistic_color_mode
private

Definition at line 303 of file schema_basic.py.

◆ _optimistic_color_temp

homeassistant.components.mqtt.light.schema_basic.MqttLight._optimistic_color_temp
private

Definition at line 324 of file schema_basic.py.

◆ _optimistic_effect

homeassistant.components.mqtt.light.schema_basic.MqttLight._optimistic_effect
private

Definition at line 327 of file schema_basic.py.

◆ _optimistic_hs_color

homeassistant.components.mqtt.light.schema_basic.MqttLight._optimistic_hs_color
private

Definition at line 328 of file schema_basic.py.

◆ _optimistic_rgb_color

homeassistant.components.mqtt.light.schema_basic.MqttLight._optimistic_rgb_color
private

Definition at line 308 of file schema_basic.py.

◆ _optimistic_rgbw_color

homeassistant.components.mqtt.light.schema_basic.MqttLight._optimistic_rgbw_color
private

Definition at line 309 of file schema_basic.py.

◆ _optimistic_rgbww_color

homeassistant.components.mqtt.light.schema_basic.MqttLight._optimistic_rgbww_color
private

Definition at line 310 of file schema_basic.py.

◆ _optimistic_xy_color

homeassistant.components.mqtt.light.schema_basic.MqttLight._optimistic_xy_color
private

Definition at line 329 of file schema_basic.py.

◆ _payload

homeassistant.components.mqtt.light.schema_basic.MqttLight._payload
private

Definition at line 288 of file schema_basic.py.

◆ _topic

homeassistant.components.mqtt.light.schema_basic.MqttLight._topic
private

Definition at line 287 of file schema_basic.py.

◆ _value_templates

homeassistant.components.mqtt.light.schema_basic.MqttLight._value_templates
private

Definition at line 290 of file schema_basic.py.


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