diff --git a/homeassistant/components/mqtt/alarm_control_panel.py b/homeassistant/components/mqtt/alarm_control_panel.py index a0d065cc7fe..aa796d9ea8f 100644 --- a/homeassistant/components/mqtt/alarm_control_panel.py +++ b/homeassistant/components/mqtt/alarm_control_panel.py @@ -112,7 +112,7 @@ PLATFORM_SCHEMA_MODERN = MQTT_BASE_SCHEMA.extend( } ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema) -# Configuring MQTT alarm control panels under the alarm_control_panel platform key is deprecated in HA Core 2022.6 +# Configuring MQTT alarm control panels under the alarm_control_panel platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(alarm.DOMAIN), diff --git a/homeassistant/components/mqtt/binary_sensor.py b/homeassistant/components/mqtt/binary_sensor.py index 12b402065ce..bbbcb97ada6 100644 --- a/homeassistant/components/mqtt/binary_sensor.py +++ b/homeassistant/components/mqtt/binary_sensor.py @@ -69,7 +69,7 @@ PLATFORM_SCHEMA_MODERN = MQTT_RO_SCHEMA.extend( } ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema) -# Configuring MQTT Binary sensors under the binary_sensor platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Binary sensors under the binary_sensor platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(binary_sensor.DOMAIN), diff --git a/homeassistant/components/mqtt/button.py b/homeassistant/components/mqtt/button.py index 71f59b8cda7..929e270f300 100644 --- a/homeassistant/components/mqtt/button.py +++ b/homeassistant/components/mqtt/button.py @@ -46,7 +46,7 @@ PLATFORM_SCHEMA_MODERN = MQTT_BASE_SCHEMA.extend( } ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema) -# Configuring MQTT Buttons under the button platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Buttons under the button platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(button.DOMAIN), diff --git a/homeassistant/components/mqtt/camera.py b/homeassistant/components/mqtt/camera.py index 26688756aa4..6ece232775a 100644 --- a/homeassistant/components/mqtt/camera.py +++ b/homeassistant/components/mqtt/camera.py @@ -56,7 +56,7 @@ PLATFORM_SCHEMA_MODERN = vol.All( PLATFORM_SCHEMA_BASE.schema, ) -# Configuring MQTT Camera under the camera platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Camera under the camera platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(camera.DOMAIN), diff --git a/homeassistant/components/mqtt/climate.py b/homeassistant/components/mqtt/climate.py index 0d3313a4475..7d6d2ff7b2c 100644 --- a/homeassistant/components/mqtt/climate.py +++ b/homeassistant/components/mqtt/climate.py @@ -307,7 +307,7 @@ PLATFORM_SCHEMA_MODERN = vol.All( valid_preset_mode_configuration, ) -# Configuring MQTT Climate under the climate platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Climate under the climate platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(climate.DOMAIN), diff --git a/homeassistant/components/mqtt/cover.py b/homeassistant/components/mqtt/cover.py index 4d230c20ae2..7f9b5dc3e85 100644 --- a/homeassistant/components/mqtt/cover.py +++ b/homeassistant/components/mqtt/cover.py @@ -204,7 +204,7 @@ PLATFORM_SCHEMA_MODERN = vol.All( validate_options, ) -# Configuring MQTT Covers under the cover platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Covers under the cover platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(cover.DOMAIN), diff --git a/homeassistant/components/mqtt/device_tracker.py b/homeassistant/components/mqtt/device_tracker.py index 41902349de4..26dc016e07e 100644 --- a/homeassistant/components/mqtt/device_tracker.py +++ b/homeassistant/components/mqtt/device_tracker.py @@ -59,7 +59,7 @@ PLATFORM_SCHEMA_MODERN = MQTT_RO_SCHEMA.extend( DISCOVERY_SCHEMA = PLATFORM_SCHEMA_MODERN.extend({}, extra=vol.REMOVE_EXTRA) -# Configuring MQTT Device Trackers under the device_tracker platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Device Trackers under the device_tracker platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All(warn_for_legacy_schema(device_tracker.DOMAIN)) diff --git a/homeassistant/components/mqtt/fan.py b/homeassistant/components/mqtt/fan.py index 9da7721a7dc..2623845fffd 100644 --- a/homeassistant/components/mqtt/fan.py +++ b/homeassistant/components/mqtt/fan.py @@ -183,7 +183,7 @@ _PLATFORM_SCHEMA_BASE = MQTT_RW_SCHEMA.extend( } ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema) -# Configuring MQTT Fans under the fan platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Fans under the fan platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(fan.DOMAIN), @@ -518,7 +518,6 @@ class MqttFan(MqttEntity, FanEntity): # The default for FanEntity is to compute it based on percentage return self._attr_is_on - # The speed attribute deprecated in the schema, support will be removed after a quarter (2021.7) async def async_turn_on( self, percentage: int | None = None, diff --git a/homeassistant/components/mqtt/humidifier.py b/homeassistant/components/mqtt/humidifier.py index d386aade32a..38d3e46ea45 100644 --- a/homeassistant/components/mqtt/humidifier.py +++ b/homeassistant/components/mqtt/humidifier.py @@ -149,7 +149,7 @@ _PLATFORM_SCHEMA_BASE = MQTT_RW_SCHEMA.extend( } ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema) -# Configuring MQTT Humidifiers under the humidifier platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Humidifiers under the humidifier platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(humidifier.DOMAIN), diff --git a/homeassistant/components/mqtt/light/__init__.py b/homeassistant/components/mqtt/light/__init__.py index 5860a011ab5..e7b2dcf5ae4 100644 --- a/homeassistant/components/mqtt/light/__init__.py +++ b/homeassistant/components/mqtt/light/__init__.py @@ -72,7 +72,7 @@ DISCOVERY_SCHEMA = vol.All( validate_mqtt_light_discovery, ) -# Configuring MQTT Lights under the light platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Lights under the light platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(light.DOMAIN), diff --git a/homeassistant/components/mqtt/light/schema_basic.py b/homeassistant/components/mqtt/light/schema_basic.py index 689d388b92a..d2f8a5ac03e 100644 --- a/homeassistant/components/mqtt/light/schema_basic.py +++ b/homeassistant/components/mqtt/light/schema_basic.py @@ -224,7 +224,7 @@ _PLATFORM_SCHEMA_BASE = ( .extend(MQTT_LIGHT_SCHEMA_SCHEMA.schema) ) -# The use of PLATFORM_SCHEMA is deprecated in HA Core 2022.6 +# The use of PLATFORM_SCHEMA was deprecated in HA Core 2022.6 PLATFORM_SCHEMA_BASIC = vol.All( cv.PLATFORM_SCHEMA.extend(_PLATFORM_SCHEMA_BASE.schema), ) diff --git a/homeassistant/components/mqtt/light/schema_json.py b/homeassistant/components/mqtt/light/schema_json.py index 9547b6d31a8..09413e1f0ac 100644 --- a/homeassistant/components/mqtt/light/schema_json.py +++ b/homeassistant/components/mqtt/light/schema_json.py @@ -158,7 +158,7 @@ _PLATFORM_SCHEMA_BASE = ( .extend(MQTT_LIGHT_SCHEMA_SCHEMA.schema) ) -# Configuring MQTT Lights under the light platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Lights under the light platform key was deprecated in HA Core 2022.6 PLATFORM_SCHEMA_JSON = vol.All( cv.PLATFORM_SCHEMA.extend(_PLATFORM_SCHEMA_BASE.schema), valid_color_configuration, diff --git a/homeassistant/components/mqtt/light/schema_template.py b/homeassistant/components/mqtt/light/schema_template.py index 7e3c8a0a751..21691acc916 100644 --- a/homeassistant/components/mqtt/light/schema_template.py +++ b/homeassistant/components/mqtt/light/schema_template.py @@ -112,7 +112,7 @@ _PLATFORM_SCHEMA_BASE = ( .extend(MQTT_LIGHT_SCHEMA_SCHEMA.schema) ) -# Configuring MQTT Lights under the light platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Lights under the light platform key was deprecated in HA Core 2022.6 PLATFORM_SCHEMA_TEMPLATE = vol.All( cv.PLATFORM_SCHEMA.extend(_PLATFORM_SCHEMA_BASE.schema), ) diff --git a/homeassistant/components/mqtt/lock.py b/homeassistant/components/mqtt/lock.py index 525d85b5a6c..b956f2e1b88 100644 --- a/homeassistant/components/mqtt/lock.py +++ b/homeassistant/components/mqtt/lock.py @@ -70,7 +70,7 @@ PLATFORM_SCHEMA_MODERN = MQTT_RW_SCHEMA.extend( } ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema) -# Configuring MQTT Locks under the lock platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Locks under the lock platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(lock.DOMAIN), diff --git a/homeassistant/components/mqtt/number.py b/homeassistant/components/mqtt/number.py index b81ce113a88..6d56354368e 100644 --- a/homeassistant/components/mqtt/number.py +++ b/homeassistant/components/mqtt/number.py @@ -107,7 +107,7 @@ PLATFORM_SCHEMA_MODERN = vol.All( validate_config, ) -# Configuring MQTT Number under the number platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Number under the number platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(number.DOMAIN), diff --git a/homeassistant/components/mqtt/scene.py b/homeassistant/components/mqtt/scene.py index f671daea2b2..3454102e5e0 100644 --- a/homeassistant/components/mqtt/scene.py +++ b/homeassistant/components/mqtt/scene.py @@ -45,7 +45,7 @@ PLATFORM_SCHEMA_MODERN = MQTT_BASE_SCHEMA.extend( } ).extend(MQTT_AVAILABILITY_SCHEMA.schema) -# Configuring MQTT Scenes under the scene platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Scenes under the scene platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(scene.DOMAIN), diff --git a/homeassistant/components/mqtt/select.py b/homeassistant/components/mqtt/select.py index c7e00420cbc..d574cf081ba 100644 --- a/homeassistant/components/mqtt/select.py +++ b/homeassistant/components/mqtt/select.py @@ -67,7 +67,7 @@ PLATFORM_SCHEMA_MODERN = MQTT_RW_SCHEMA.extend( }, ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema) -# Configuring MQTT Select under the select platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Select under the select platform key was deprecated in HA Core 2022.6 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(select.DOMAIN), ) diff --git a/homeassistant/components/mqtt/sensor.py b/homeassistant/components/mqtt/sensor.py index fd42d5539ec..092ab88b28d 100644 --- a/homeassistant/components/mqtt/sensor.py +++ b/homeassistant/components/mqtt/sensor.py @@ -114,7 +114,7 @@ PLATFORM_SCHEMA_MODERN = vol.All( validate_options, ) -# Configuring MQTT Sensors under the sensor platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Sensors under the sensor platform key was deprecated in HA Core 2022.6 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(sensor.DOMAIN), ) diff --git a/homeassistant/components/mqtt/siren.py b/homeassistant/components/mqtt/siren.py index 0e6c3c3dec1..350f02427e5 100644 --- a/homeassistant/components/mqtt/siren.py +++ b/homeassistant/components/mqtt/siren.py @@ -97,7 +97,7 @@ PLATFORM_SCHEMA_MODERN = MQTT_RW_SCHEMA.extend( }, ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema) -# Configuring MQTT Sirens under the siren platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Sirens under the siren platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(siren.DOMAIN), diff --git a/homeassistant/components/mqtt/switch.py b/homeassistant/components/mqtt/switch.py index ffcb829e3a7..09e72955e63 100644 --- a/homeassistant/components/mqtt/switch.py +++ b/homeassistant/components/mqtt/switch.py @@ -66,7 +66,7 @@ PLATFORM_SCHEMA_MODERN = MQTT_RW_SCHEMA.extend( } ).extend(MQTT_ENTITY_COMMON_SCHEMA.schema) -# Configuring MQTT Switches under the switch platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Switches under the switch platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(switch.DOMAIN), diff --git a/homeassistant/components/mqtt/vacuum/__init__.py b/homeassistant/components/mqtt/vacuum/__init__.py index 87b76930312..60f8d7a7d45 100644 --- a/homeassistant/components/mqtt/vacuum/__init__.py +++ b/homeassistant/components/mqtt/vacuum/__init__.py @@ -34,7 +34,7 @@ def validate_mqtt_vacuum_discovery(config_value: ConfigType) -> ConfigType: return config -# Configuring MQTT Vacuums under the vacuum platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Vacuums under the vacuum platform key was deprecated in HA Core 2022.6 def validate_mqtt_vacuum(config_value: ConfigType) -> ConfigType: """Validate MQTT vacuum schema (deprecated).""" schemas = {LEGACY: PLATFORM_SCHEMA_LEGACY, STATE: PLATFORM_SCHEMA_STATE} @@ -56,7 +56,7 @@ DISCOVERY_SCHEMA = vol.All( MQTT_VACUUM_SCHEMA.extend({}, extra=vol.ALLOW_EXTRA), validate_mqtt_vacuum_discovery ) -# Configuring MQTT Vacuums under the vacuum platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Vacuums under the vacuum platform key was deprecated in HA Core 2022.6 # Setup for the legacy YAML format was removed in HA Core 2022.12 PLATFORM_SCHEMA = vol.All( warn_for_legacy_schema(vacuum.DOMAIN), diff --git a/homeassistant/components/mqtt/vacuum/schema_legacy.py b/homeassistant/components/mqtt/vacuum/schema_legacy.py index 68618aba20c..c8f8afd70df 100644 --- a/homeassistant/components/mqtt/vacuum/schema_legacy.py +++ b/homeassistant/components/mqtt/vacuum/schema_legacy.py @@ -160,7 +160,7 @@ PLATFORM_SCHEMA_LEGACY_MODERN = ( .extend(MQTT_VACUUM_SCHEMA.schema) ) -# Configuring MQTT Vacuums under the vacuum platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Vacuums under the vacuum platform key was deprecated in HA Core 2022.6 PLATFORM_SCHEMA_LEGACY = vol.All( cv.PLATFORM_SCHEMA.extend(PLATFORM_SCHEMA_LEGACY_MODERN.schema), warn_for_legacy_schema(VACUUM_DOMAIN), diff --git a/homeassistant/components/mqtt/vacuum/schema_state.py b/homeassistant/components/mqtt/vacuum/schema_state.py index a854d3b0620..4e020c630a5 100644 --- a/homeassistant/components/mqtt/vacuum/schema_state.py +++ b/homeassistant/components/mqtt/vacuum/schema_state.py @@ -154,7 +154,7 @@ PLATFORM_SCHEMA_STATE_MODERN = ( .extend(MQTT_VACUUM_SCHEMA.schema) ) -# Configuring MQTT Vacuums under the vacuum platform key is deprecated in HA Core 2022.6 +# Configuring MQTT Vacuums under the vacuum platform key was deprecated in HA Core 2022.6 PLATFORM_SCHEMA_STATE = vol.All( cv.PLATFORM_SCHEMA.extend(PLATFORM_SCHEMA_STATE_MODERN.schema), warn_for_legacy_schema(VACUUM_DOMAIN), diff --git a/tests/components/mqtt/test_climate.py b/tests/components/mqtt/test_climate.py index eb4c71dd254..dd86c41dcc7 100644 --- a/tests/components/mqtt/test_climate.py +++ b/tests/components/mqtt/test_climate.py @@ -120,7 +120,6 @@ async def test_preset_none_in_preset_modes(hass, caplog): assert "Invalid config for [mqtt]: not a valid value" in caplog.text -# AWAY and HOLD mode topics and templates are deprecated, support will be removed with release 2022.9 @pytest.mark.parametrize( "parameter,config_value", [ diff --git a/tests/components/mqtt/test_discovery.py b/tests/components/mqtt/test_discovery.py index 48c1d88a9a8..89a56903c3b 100644 --- a/tests/components/mqtt/test_discovery.py +++ b/tests/components/mqtt/test_discovery.py @@ -1238,7 +1238,6 @@ async def test_no_implicit_state_topic_switch( async_fire_mqtt_message(hass, "homeassistant/switch/bla/config", data) await hass.async_block_till_done() - assert "implicit state_topic is deprecated" not in caplog.text state = hass.states.get("switch.Test1") assert state is not None diff --git a/tests/components/mqtt/test_init.py b/tests/components/mqtt/test_init.py index 12b36a2fae3..ced93a8c997 100644 --- a/tests/components/mqtt/test_init.py +++ b/tests/components/mqtt/test_init.py @@ -2720,8 +2720,8 @@ async def test_subscribe_connection_status( assert mqtt_connected_calls[1] is False -# Test deprecated YAML configuration under the platform key -# Scheduled to be removed in HA core 2022.12 +# Test existence of removed YAML configuration under the platform key +# This warning and test is to be removed from HA core 2023.6 async def test_one_deprecation_warning_per_platform( hass, mqtt_mock_entry_with_yaml_config, caplog ): @@ -2810,8 +2810,6 @@ async def test_publish_or_subscribe_without_valid_config_entry(hass, caplog): @patch("homeassistant.components.mqtt.PLATFORMS", [Platform.LIGHT]) async def test_reload_entry_with_new_config(hass, tmp_path): """Test reloading the config entry with a new yaml config.""" - # Test deprecated YAML configuration under the platform key - # Scheduled to be removed in HA core 2022.12 config_old = { "mqtt": {"light": [{"name": "test_old1", "command_topic": "test-topic_old"}]} } diff --git a/tests/components/mqtt/test_light.py b/tests/components/mqtt/test_light.py index 9e64d1c45a7..2404d8a0f1f 100644 --- a/tests/components/mqtt/test_light.py +++ b/tests/components/mqtt/test_light.py @@ -2216,11 +2216,12 @@ async def test_discovery_removal_light(hass, mqtt_mock_entry_no_yaml_config, cap ) -# Test deprecated YAML configuration under the platform key -# Scheduled to be removed in HA core 2022.12 -async def test_discovery_deprecated(hass, mqtt_mock_entry_no_yaml_config, caplog): - """Test discovery of mqtt light with deprecated platform option.""" +async def test_discovery_ignores_extra_keys( + hass, mqtt_mock_entry_no_yaml_config, caplog +): + """Test discovery ignores extra keys that are not blocked.""" await mqtt_mock_entry_no_yaml_config() + # inserted `platform` key should be ignored data = ( '{ "name": "Beer",' ' "platform": "mqtt",' ' "command_topic": "test_topic"}' )