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

Public Member Functions

None async_turn_off (self, **Any kwargs)
 
None async_turn_on (self, **Any kwargs)
 
ColorMode|str|None color_mode (self)
 
- 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)
 
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 ()
 

Static Public Attributes

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

Private Member Functions

None _prepare_subscribe_topics (self)
 
tuple[int,...] _scale_rgbxx (self, tuple[int,...] rgbxx, Any kwargs)
 
None _set_flash_and_transition (self, dict[str, Any] message, **Any kwargs)
 
None _setup_from_config (self, ConfigType config)
 
None _state_received (self, ReceiveMessage msg)
 
None _subscribe_topics (self)
 
bool _supports_color_mode (self, ColorMode|str color_mode)
 
None _update_color (self, dict[str, Any] values)
 

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
 
 _deprecated_color_handling
 
 _fixed_color_mode
 
 _flash_times
 
 _optimistic
 
 _topic
 

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
 

Detailed Description

Representation of a MQTT JSON light.

Definition at line 255 of file schema_json.py.

Member Function Documentation

◆ _prepare_subscribe_topics()

None homeassistant.components.mqtt.light.schema_json.MqttLightJson._prepare_subscribe_topics (   self)
private
(Re)Subscribe to topics.

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

Definition at line 492 of file schema_json.py.

◆ _scale_rgbxx()

tuple[int, ...] homeassistant.components.mqtt.light.schema_json.MqttLightJson._scale_rgbxx (   self,
tuple[int, ...]  rgbxx,
Any  kwargs 
)
private

Definition at line 564 of file schema_json.py.

◆ _set_flash_and_transition()

None homeassistant.components.mqtt.light.schema_json.MqttLightJson._set_flash_and_transition (   self,
dict[str, Any]  message,
**Any  kwargs 
)
private

Definition at line 552 of file schema_json.py.

◆ _setup_from_config()

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

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

Definition at line 274 of file schema_json.py.

◆ _state_received()

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

Definition at line 416 of file schema_json.py.

◆ _subscribe_topics()

None homeassistant.components.mqtt.light.schema_json.MqttLightJson._subscribe_topics (   self)
private
(Re)Subscribe to topics.

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

Definition at line 511 of file schema_json.py.

◆ _supports_color_mode()

bool homeassistant.components.mqtt.light.schema_json.MqttLightJson._supports_color_mode (   self,
ColorMode | str  color_mode 
)
private
Return True if the light natively supports a color mode.

Definition at line 575 of file schema_json.py.

◆ _update_color()

None homeassistant.components.mqtt.light.schema_json.MqttLightJson._update_color (   self,
dict[str, Any]  values 
)
private

Definition at line 317 of file schema_json.py.

◆ async_turn_off()

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

This method is a coroutine.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 734 of file schema_json.py.

◆ async_turn_on()

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

This method is a coroutine.

Reimplemented from homeassistant.helpers.entity.ToggleEntity.

Definition at line 583 of file schema_json.py.

◆ color_mode()

ColorMode | str | None homeassistant.components.mqtt.light.schema_json.MqttLightJson.color_mode (   self)
Return current color mode.

Reimplemented from homeassistant.components.light.LightEntity.

Definition at line 540 of file schema_json.py.

◆ config_schema()

VolSchemaType homeassistant.components.mqtt.light.schema_json.MqttLightJson.config_schema ( )
static
Return the config schema.

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

Definition at line 270 of file schema_json.py.

Member Data Documentation

◆ _attr_assumed_state

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_assumed_state
private

Definition at line 285 of file schema_json.py.

◆ _attr_brightness

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_brightness
private

Definition at line 446 of file schema_json.py.

◆ _attr_color_mode

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_color_mode
private

Definition at line 301 of file schema_json.py.

◆ _attr_color_temp

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_color_temp
private

Definition at line 373 of file schema_json.py.

◆ _attr_effect

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_effect
private

Definition at line 489 of file schema_json.py.

◆ _attr_effect_list

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_effect_list
private

Definition at line 278 of file schema_json.py.

◆ _attr_hs_color

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_hs_color
private

Definition at line 324 of file schema_json.py.

◆ _attr_is_on

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_is_on
private

Definition at line 421 of file schema_json.py.

◆ _attr_max_mireds

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_max_mireds
private

Definition at line 276 of file schema_json.py.

◆ _attr_min_mireds

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_min_mireds
private

Definition at line 277 of file schema_json.py.

◆ _attr_rgb_color

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_rgb_color
private

Definition at line 385 of file schema_json.py.

◆ _attr_rgbw_color

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_rgbw_color
private

Definition at line 392 of file schema_json.py.

◆ _attr_rgbww_color

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_rgbww_color
private

Definition at line 400 of file schema_json.py.

◆ _attr_supported_color_modes

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_supported_color_modes
private

Definition at line 299 of file schema_json.py.

◆ _attr_supported_features

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_supported_features
private

Definition at line 292 of file schema_json.py.

◆ _attr_xy_color

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attr_xy_color
private

Definition at line 407 of file schema_json.py.

◆ _attributes_extra_blocked

homeassistant.components.mqtt.light.schema_json.MqttLightJson._attributes_extra_blocked = MQTT_LIGHT_ATTRIBUTES_BLOCKED
staticprivate

Definition at line 260 of file schema_json.py.

◆ _default_name

homeassistant.components.mqtt.light.schema_json.MqttLightJson._default_name = DEFAULT_NAME
staticprivate

Definition at line 258 of file schema_json.py.

◆ _deprecated_color_handling

homeassistant.components.mqtt.light.schema_json.MqttLightJson._deprecated_color_handling
private

Definition at line 305 of file schema_json.py.

◆ _entity_id_format

homeassistant.components.mqtt.light.schema_json.MqttLightJson._entity_id_format = ENTITY_ID_FORMAT
staticprivate

Definition at line 259 of file schema_json.py.

◆ _fixed_color_mode

homeassistant.components.mqtt.light.schema_json.MqttLightJson._fixed_color_mode
private

Definition at line 315 of file schema_json.py.

◆ _flash_times

homeassistant.components.mqtt.light.schema_json.MqttLightJson._flash_times
private

Definition at line 287 of file schema_json.py.

◆ _optimistic

homeassistant.components.mqtt.light.schema_json.MqttLightJson._optimistic
private

Definition at line 284 of file schema_json.py.

◆ _topic

homeassistant.components.mqtt.light.schema_json.MqttLightJson._topic
private

Definition at line 280 of file schema_json.py.

◆ bool

homeassistant.components.mqtt.light.schema_json.MqttLightJson.bool
static

Definition at line 267 of file schema_json.py.

◆ None

homeassistant.components.mqtt.light.schema_json.MqttLightJson.None
static

Definition at line 262 of file schema_json.py.


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