Deprecate white_value support in MQTT light (#71002)

pull/71061/head
Erik Montnemery 2022-04-29 08:37:49 +02:00 committed by GitHub
parent c7d344692f
commit 2f9beb4a4a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 26 additions and 2 deletions

View File

@ -221,12 +221,22 @@ _PLATFORM_SCHEMA_BASE = (
)
PLATFORM_SCHEMA_BASIC = vol.All(
# CONF_WHITE_VALUE_* is deprecated, support will be removed in release 2022.9
cv.deprecated(CONF_WHITE_VALUE_COMMAND_TOPIC),
cv.deprecated(CONF_WHITE_VALUE_SCALE),
cv.deprecated(CONF_WHITE_VALUE_STATE_TOPIC),
cv.deprecated(CONF_WHITE_VALUE_TEMPLATE),
_PLATFORM_SCHEMA_BASE,
)
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 deprecated, support will be removed in release 2022.9
cv.deprecated(CONF_WHITE_VALUE_COMMAND_TOPIC),
cv.deprecated(CONF_WHITE_VALUE_SCALE),
cv.deprecated(CONF_WHITE_VALUE_STATE_TOPIC),
cv.deprecated(CONF_WHITE_VALUE_TEMPLATE),
_PLATFORM_SCHEMA_BASE.extend({}, extra=vol.REMOVE_EXTRA),
)

View File

@ -149,11 +149,15 @@ _PLATFORM_SCHEMA_BASE = (
)
PLATFORM_SCHEMA_JSON = vol.All(
# CONF_WHITE_VALUE is deprecated, support will be removed in release 2022.9
cv.deprecated(CONF_WHITE_VALUE),
_PLATFORM_SCHEMA_BASE,
valid_color_configuration,
)
DISCOVERY_SCHEMA_JSON = vol.All(
# CONF_WHITE_VALUE is deprecated, support will be removed in release 2022.9
cv.deprecated(CONF_WHITE_VALUE),
_PLATFORM_SCHEMA_BASE.extend({}, extra=vol.REMOVE_EXTRA),
valid_color_configuration,
)

View File

@ -68,7 +68,7 @@ CONF_MIN_MIREDS = "min_mireds"
CONF_RED_TEMPLATE = "red_template"
CONF_WHITE_VALUE_TEMPLATE = "white_value_template"
PLATFORM_SCHEMA_TEMPLATE = (
_PLATFORM_SCHEMA_BASE = (
mqtt.MQTT_RW_PLATFORM_SCHEMA.extend(
{
vol.Optional(CONF_BLUE_TEMPLATE): cv.template,
@ -92,7 +92,17 @@ PLATFORM_SCHEMA_TEMPLATE = (
.extend(MQTT_LIGHT_SCHEMA_SCHEMA.schema)
)
DISCOVERY_SCHEMA_TEMPLATE = PLATFORM_SCHEMA_TEMPLATE.extend({}, extra=vol.REMOVE_EXTRA)
PLATFORM_SCHEMA_TEMPLATE = vol.All(
# CONF_WHITE_VALUE_TEMPLATE is deprecated, support will be removed in release 2022.9
cv.deprecated(CONF_WHITE_VALUE_TEMPLATE),
_PLATFORM_SCHEMA_BASE,
)
DISCOVERY_SCHEMA_TEMPLATE = vol.All(
# CONF_WHITE_VALUE_TEMPLATE is deprecated, support will be removed in release 2022.9
cv.deprecated(CONF_WHITE_VALUE_TEMPLATE),
_PLATFORM_SCHEMA_BASE.extend({}, extra=vol.REMOVE_EXTRA),
)
async def async_setup_entity_template(