diff --git a/homeassistant/components/mqtt/light/schema_basic.py b/homeassistant/components/mqtt/light/schema_basic.py index b1f3dc7c59b46a..2030cfb88257d2 100644 --- a/homeassistant/components/mqtt/light/schema_basic.py +++ b/homeassistant/components/mqtt/light/schema_basic.py @@ -122,7 +122,9 @@ CONF_XY_VALUE_TEMPLATE, ] -PLATFORM_SCHEMA_BASIC = ( +PLATFORM_SCHEMA_BASIC = vol.All( + # CONF_VALUE_TEMPLATE is deprecated, support will be removed in 2021.10 + cv.deprecated(CONF_VALUE_TEMPLATE, CONF_STATE_VALUE_TEMPLATE), mqtt.MQTT_RW_PLATFORM_SCHEMA.extend( { vol.Optional(CONF_BRIGHTNESS_COMMAND_TOPIC): mqtt.valid_publish_topic, @@ -179,7 +181,7 @@ } ) .extend(MQTT_ENTITY_COMMON_SCHEMA.schema) - .extend(MQTT_LIGHT_SCHEMA_SCHEMA.schema) + .extend(MQTT_LIGHT_SCHEMA_SCHEMA.schema), ) diff --git a/tests/components/mqtt/test_light.py b/tests/components/mqtt/test_light.py index e419743bd870ef..728656743e5c9b 100644 --- a/tests/components/mqtt/test_light.py +++ b/tests/components/mqtt/test_light.py @@ -1103,7 +1103,7 @@ async def test_controlling_state_via_topic_with_templates(hass, mqtt_mock): assert state.attributes.get(light.ATTR_SUPPORTED_COLOR_MODES) == color_modes -async def test_controlling_state_via_topic_with_value_template(hass, mqtt_mock): +async def test_controlling_state_via_topic_with_value_template(hass, mqtt_mock, caplog): """Test the setting of the state with undocumented value_template.""" config = { light.DOMAIN: { @@ -1118,6 +1118,8 @@ async def test_controlling_state_via_topic_with_value_template(hass, mqtt_mock): assert await async_setup_component(hass, light.DOMAIN, config) await hass.async_block_till_done() + assert "The 'value_template' option is deprecated" in caplog.text + state = hass.states.get("light.test") assert state.state == STATE_OFF