mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Remove deprecated features from MQTT platforms (#32909)
* Remove deprecated features * Lint
This commit is contained in:
@@ -91,8 +91,7 @@ import json
|
||||
from unittest import mock
|
||||
from unittest.mock import patch
|
||||
|
||||
from homeassistant.components import light, mqtt
|
||||
from homeassistant.components.mqtt.discovery import async_start
|
||||
from homeassistant.components import light
|
||||
from homeassistant.const import (
|
||||
ATTR_ASSUMED_STATE,
|
||||
ATTR_SUPPORTED_FEATURES,
|
||||
@@ -122,7 +121,7 @@ from .common import (
|
||||
help_test_update_with_json_attrs_not_dict,
|
||||
)
|
||||
|
||||
from tests.common import MockConfigEntry, async_fire_mqtt_message, mock_coro
|
||||
from tests.common import async_fire_mqtt_message, mock_coro
|
||||
from tests.components.light import common
|
||||
|
||||
DEFAULT_CONFIG = {
|
||||
@@ -1061,22 +1060,6 @@ async def test_discovery_removal(hass, mqtt_mock, caplog):
|
||||
await help_test_discovery_removal(hass, mqtt_mock, caplog, light.DOMAIN, data)
|
||||
|
||||
|
||||
async def test_discovery_deprecated(hass, mqtt_mock, caplog):
|
||||
"""Test discovery of mqtt_json light with deprecated platform option."""
|
||||
entry = MockConfigEntry(domain=mqtt.DOMAIN)
|
||||
await async_start(hass, "homeassistant", {"mqtt": {}}, entry)
|
||||
data = (
|
||||
'{ "name": "Beer",'
|
||||
' "platform": "mqtt_json",'
|
||||
' "command_topic": "test_topic"}'
|
||||
)
|
||||
async_fire_mqtt_message(hass, "homeassistant/light/bla/config", data)
|
||||
await hass.async_block_till_done()
|
||||
state = hass.states.get("light.beer")
|
||||
assert state is not None
|
||||
assert state.name == "Beer"
|
||||
|
||||
|
||||
async def test_discovery_update_light(hass, mqtt_mock, caplog):
|
||||
"""Test update of discovered light."""
|
||||
data1 = (
|
||||
|
||||
Reference in New Issue
Block a user