Fix change of entity_id for discovered MQTT entities (#33444)
This commit is contained in:
parent
531207e005
commit
9508c51403
17 changed files with 246 additions and 61 deletions
|
@ -101,7 +101,7 @@ from homeassistant.const import (
|
|||
import homeassistant.core as ha
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from .common import (
|
||||
from .test_common import (
|
||||
help_test_availability_without_topic,
|
||||
help_test_custom_availability_payload,
|
||||
help_test_default_availability_payload,
|
||||
|
@ -113,7 +113,8 @@ from .common import (
|
|||
help_test_entity_device_info_update,
|
||||
help_test_entity_device_info_with_connection,
|
||||
help_test_entity_device_info_with_identifier,
|
||||
help_test_entity_id_update,
|
||||
help_test_entity_id_update_discovery_update,
|
||||
help_test_entity_id_update_subscriptions,
|
||||
help_test_setting_attribute_via_mqtt_json_message,
|
||||
help_test_setting_attribute_with_template,
|
||||
help_test_unique_id,
|
||||
|
@ -1121,6 +1122,15 @@ async def test_entity_device_info_remove(hass, mqtt_mock):
|
|||
)
|
||||
|
||||
|
||||
async def test_entity_id_update(hass, mqtt_mock):
|
||||
async def test_entity_id_update_subscriptions(hass, mqtt_mock):
|
||||
"""Test MQTT subscriptions are managed when entity_id is updated."""
|
||||
await help_test_entity_id_update(hass, mqtt_mock, light.DOMAIN, DEFAULT_CONFIG)
|
||||
await help_test_entity_id_update_subscriptions(
|
||||
hass, mqtt_mock, light.DOMAIN, DEFAULT_CONFIG
|
||||
)
|
||||
|
||||
|
||||
async def test_entity_id_update_discovery_update(hass, mqtt_mock):
|
||||
"""Test MQTT discovery update when entity_id is updated."""
|
||||
await help_test_entity_id_update_discovery_update(
|
||||
hass, mqtt_mock, light.DOMAIN, DEFAULT_CONFIG
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue