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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user