mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Cleanup value_template
config parameter from MQTT basic light (#87466)
* Remove not supported case from code for MQTT light * Remove from schema
This commit is contained in:
parent
ef6798e854
commit
be564e0162
@ -34,7 +34,6 @@ from homeassistant.const import (
|
|||||||
CONF_OPTIMISTIC,
|
CONF_OPTIMISTIC,
|
||||||
CONF_PAYLOAD_OFF,
|
CONF_PAYLOAD_OFF,
|
||||||
CONF_PAYLOAD_ON,
|
CONF_PAYLOAD_ON,
|
||||||
CONF_VALUE_TEMPLATE,
|
|
||||||
STATE_ON,
|
STATE_ON,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
@ -234,8 +233,6 @@ PLATFORM_SCHEMA_BASIC = vol.All(
|
|||||||
)
|
)
|
||||||
|
|
||||||
DISCOVERY_SCHEMA_BASIC = vol.All(
|
DISCOVERY_SCHEMA_BASIC = vol.All(
|
||||||
# CONF_VALUE_TEMPLATE is no longer supported, support was removed in 2022.2
|
|
||||||
cv.removed(CONF_VALUE_TEMPLATE),
|
|
||||||
# CONF_WHITE_VALUE_* is no longer supported, support was removed in 2022.9
|
# CONF_WHITE_VALUE_* is no longer supported, support was removed in 2022.9
|
||||||
cv.removed(CONF_WHITE_VALUE_COMMAND_TOPIC),
|
cv.removed(CONF_WHITE_VALUE_COMMAND_TOPIC),
|
||||||
cv.removed(CONF_WHITE_VALUE_SCALE),
|
cv.removed(CONF_WHITE_VALUE_SCALE),
|
||||||
@ -245,8 +242,6 @@ DISCOVERY_SCHEMA_BASIC = vol.All(
|
|||||||
)
|
)
|
||||||
|
|
||||||
PLATFORM_SCHEMA_MODERN_BASIC = vol.All(
|
PLATFORM_SCHEMA_MODERN_BASIC = vol.All(
|
||||||
# CONF_VALUE_TEMPLATE is no longer supported, support was removed in 2022.2
|
|
||||||
cv.removed(CONF_VALUE_TEMPLATE),
|
|
||||||
# CONF_WHITE_VALUE_* is no longer supported, support was removed in 2022.9
|
# CONF_WHITE_VALUE_* is no longer supported, support was removed in 2022.9
|
||||||
cv.removed(CONF_WHITE_VALUE_COMMAND_TOPIC),
|
cv.removed(CONF_WHITE_VALUE_COMMAND_TOPIC),
|
||||||
cv.removed(CONF_WHITE_VALUE_SCALE),
|
cv.removed(CONF_WHITE_VALUE_SCALE),
|
||||||
@ -312,9 +307,6 @@ class MqttLight(MqttEntity, LightEntity, RestoreEntity):
|
|||||||
self._attr_max_mireds = config.get(CONF_MAX_MIREDS, super().max_mireds)
|
self._attr_max_mireds = config.get(CONF_MAX_MIREDS, super().max_mireds)
|
||||||
self._attr_effect_list = config.get(CONF_EFFECT_LIST)
|
self._attr_effect_list = config.get(CONF_EFFECT_LIST)
|
||||||
|
|
||||||
if CONF_STATE_VALUE_TEMPLATE not in config and CONF_VALUE_TEMPLATE in config:
|
|
||||||
config[CONF_STATE_VALUE_TEMPLATE] = config[CONF_VALUE_TEMPLATE]
|
|
||||||
|
|
||||||
topic: dict[str, str | None] = {
|
topic: dict[str, str | None] = {
|
||||||
key: config.get(key)
|
key: config.get(key)
|
||||||
for key in (
|
for key in (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user