1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Migrate ESPHome unique ids to new format (#99451)

This commit is contained in:
J. Nick Koston
2023-10-15 17:05:20 -10:00
committed by GitHub
parent 17c9d85e0e
commit 88296c1998
5 changed files with 150 additions and 14 deletions

View File

@@ -116,7 +116,9 @@ async def test_generic_numeric_sensor_with_entity_category_and_icon(
entity_reg = er.async_get(hass)
entry = entity_reg.async_get("sensor.test_mysensor")
assert entry is not None
assert entry.unique_id == "my_sensor"
# Note that ESPHome includes the EntityInfo type in the unique id
# as this is not a 1:1 mapping to the entity platform (ie. text_sensor)
assert entry.unique_id == "11:22:33:44:55:aa-sensor-mysensor"
assert entry.entity_category is EntityCategory.DIAGNOSTIC
@@ -152,7 +154,9 @@ async def test_generic_numeric_sensor_state_class_measurement(
entity_reg = er.async_get(hass)
entry = entity_reg.async_get("sensor.test_mysensor")
assert entry is not None
assert entry.unique_id == "my_sensor"
# Note that ESPHome includes the EntityInfo type in the unique id
# as this is not a 1:1 mapping to the entity platform (ie. text_sensor)
assert entry.unique_id == "11:22:33:44:55:aa-sensor-mysensor"
assert entry.entity_category is None