mirror of
https://github.com/home-assistant/core.git
synced 2026-09-26 01:11:51 -04:00
Add unique id for min_max (#81007)
This commit is contained in:
@@ -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."""
|
||||
|
||||
Reference in New Issue
Block a user