Add unique id for min_max (#81007)

This commit is contained in:
G Johansson
2022-10-26 11:27:44 +02:00
committed by GitHub
parent 352976fd1d
commit be7e61b88b
2 changed files with 10 additions and 1 deletions
+6
View File
@@ -14,6 +14,7 @@ from homeassistant.const import (
TEMP_CELSIUS,
TEMP_FAHRENHEIT,
)
import homeassistant.helpers.entity_registry as er
from homeassistant.setup import async_setup_component
from tests.common import get_fixture_path
@@ -63,6 +64,7 @@ async def test_min_sensor(hass):
"name": "test_min",
"type": "min",
"entity_ids": ["sensor.test_1", "sensor.test_2", "sensor.test_3"],
"unique_id": "very_unique_id",
}
}
@@ -81,6 +83,10 @@ async def test_min_sensor(hass):
assert entity_ids[2] == state.attributes.get("min_entity_id")
assert state.attributes.get(ATTR_STATE_CLASS) == SensorStateClass.MEASUREMENT
entity_reg = er.async_get(hass)
entity = entity_reg.async_get("sensor.test_min")
assert entity.unique_id == "very_unique_id"
async def test_max_sensor(hass):
"""Test the max sensor."""