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

Add unique-ids to maxcube component (#49196)

This commit is contained in:
Unai
2021-04-14 22:19:24 +02:00
committed by GitHub
parent 8ce74e598d
commit aaa600e00a
4 changed files with 26 additions and 0 deletions

View File

@@ -54,6 +54,7 @@ from homeassistant.const import (
ATTR_SUPPORTED_FEATURES,
ATTR_TEMPERATURE,
)
from homeassistant.helpers import entity_registry as er
from homeassistant.util import utcnow
from tests.common import async_fire_time_changed
@@ -65,6 +66,10 @@ VALVE_POSITION = "valve_position"
async def test_setup_thermostat(hass, cube: MaxCube):
"""Test a successful setup of a thermostat device."""
entity_registry = er.async_get(hass)
assert entity_registry.async_is_registered(ENTITY_ID)
entity = entity_registry.async_get(ENTITY_ID)
assert entity.unique_id == "AABBCCDD01"
state = hass.states.get(ENTITY_ID)
assert state.state == HVAC_MODE_AUTO
@@ -94,6 +99,11 @@ async def test_setup_thermostat(hass, cube: MaxCube):
async def test_setup_wallthermostat(hass, cube: MaxCube):
"""Test a successful setup of a wall thermostat device."""
entity_registry = er.async_get(hass)
assert entity_registry.async_is_registered(WALL_ENTITY_ID)
entity = entity_registry.async_get(WALL_ENTITY_ID)
assert entity.unique_id == "AABBCCDD02"
state = hass.states.get(WALL_ENTITY_ID)
assert state.state == HVAC_MODE_OFF
assert state.attributes.get(ATTR_FRIENDLY_NAME) == "TestRoom TestWallThermostat"