Use device name as entity name in Eheim digital climate (#136997)
parent
84ae476b67
commit
6f1539f60d
|
@ -76,6 +76,7 @@ class EheimDigitalHeaterClimate(EheimDigitalEntity[EheimDigitalHeater], ClimateE
|
|||
_attr_temperature_unit = UnitOfTemperature.CELSIUS
|
||||
_attr_preset_mode = PRESET_NONE
|
||||
_attr_translation_key = "heater"
|
||||
_attr_name = None
|
||||
|
||||
def __init__(
|
||||
self, coordinator: EheimDigitalUpdateCoordinator, device: EheimDigitalHeater
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# serializer version: 1
|
||||
# name: test_dynamic_new_devices[climate.mock_heater_none-entry]
|
||||
# name: test_dynamic_new_devices[climate.mock_heater-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
|
@ -24,7 +24,7 @@
|
|||
'disabled_by': None,
|
||||
'domain': 'climate',
|
||||
'entity_category': None,
|
||||
'entity_id': 'climate.mock_heater_none',
|
||||
'entity_id': 'climate.mock_heater',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
|
@ -45,11 +45,11 @@
|
|||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_dynamic_new_devices[climate.mock_heater_none-state]
|
||||
# name: test_dynamic_new_devices[climate.mock_heater-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'current_temperature': 24.2,
|
||||
'friendly_name': 'Mock Heater None',
|
||||
'friendly_name': 'Mock Heater',
|
||||
'hvac_action': <HVACAction.HEATING: 'heating'>,
|
||||
'hvac_modes': list([
|
||||
<HVACMode.OFF: 'off'>,
|
||||
|
@ -68,14 +68,14 @@
|
|||
'temperature': 25.5,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'climate.mock_heater_none',
|
||||
'entity_id': 'climate.mock_heater',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
'state': 'auto',
|
||||
})
|
||||
# ---
|
||||
# name: test_setup_heater[climate.mock_heater_none-entry]
|
||||
# name: test_setup_heater[climate.mock_heater-entry]
|
||||
EntityRegistryEntrySnapshot({
|
||||
'aliases': set({
|
||||
}),
|
||||
|
@ -100,7 +100,7 @@
|
|||
'disabled_by': None,
|
||||
'domain': 'climate',
|
||||
'entity_category': None,
|
||||
'entity_id': 'climate.mock_heater_none',
|
||||
'entity_id': 'climate.mock_heater',
|
||||
'has_entity_name': True,
|
||||
'hidden_by': None,
|
||||
'icon': None,
|
||||
|
@ -121,11 +121,11 @@
|
|||
'unit_of_measurement': None,
|
||||
})
|
||||
# ---
|
||||
# name: test_setup_heater[climate.mock_heater_none-state]
|
||||
# name: test_setup_heater[climate.mock_heater-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'current_temperature': 24.2,
|
||||
'friendly_name': 'Mock Heater None',
|
||||
'friendly_name': 'Mock Heater',
|
||||
'hvac_action': <HVACAction.HEATING: 'heating'>,
|
||||
'hvac_modes': list([
|
||||
<HVACMode.OFF: 'off'>,
|
||||
|
@ -144,7 +144,7 @@
|
|||
'temperature': 25.5,
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'climate.mock_heater_none',
|
||||
'entity_id': 'climate.mock_heater',
|
||||
'last_changed': <ANY>,
|
||||
'last_reported': <ANY>,
|
||||
'last_updated': <ANY>,
|
||||
|
|
|
@ -123,7 +123,7 @@ async def test_set_preset_mode(
|
|||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN,
|
||||
SERVICE_SET_PRESET_MODE,
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater_none", ATTR_PRESET_MODE: preset_mode},
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_PRESET_MODE: preset_mode},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
|
@ -132,7 +132,7 @@ async def test_set_preset_mode(
|
|||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN,
|
||||
SERVICE_SET_PRESET_MODE,
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater_none", ATTR_PRESET_MODE: preset_mode},
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_PRESET_MODE: preset_mode},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
|
@ -161,7 +161,7 @@ async def test_set_temperature(
|
|||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN,
|
||||
SERVICE_SET_TEMPERATURE,
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater_none", ATTR_TEMPERATURE: 26.0},
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_TEMPERATURE: 26.0},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
|
@ -170,7 +170,7 @@ async def test_set_temperature(
|
|||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN,
|
||||
SERVICE_SET_TEMPERATURE,
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater_none", ATTR_TEMPERATURE: 26.0},
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_TEMPERATURE: 26.0},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
|
@ -204,7 +204,7 @@ async def test_set_hvac_mode(
|
|||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN,
|
||||
SERVICE_SET_HVAC_MODE,
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater_none", ATTR_HVAC_MODE: hvac_mode},
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_HVAC_MODE: hvac_mode},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
|
@ -213,7 +213,7 @@ async def test_set_hvac_mode(
|
|||
await hass.services.async_call(
|
||||
CLIMATE_DOMAIN,
|
||||
SERVICE_SET_HVAC_MODE,
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater_none", ATTR_HVAC_MODE: hvac_mode},
|
||||
{ATTR_ENTITY_ID: "climate.mock_heater", ATTR_HVAC_MODE: hvac_mode},
|
||||
blocking=True,
|
||||
)
|
||||
|
||||
|
@ -239,7 +239,7 @@ async def test_state_update(
|
|||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert (state := hass.states.get("climate.mock_heater_none"))
|
||||
assert (state := hass.states.get("climate.mock_heater"))
|
||||
|
||||
assert state.attributes["hvac_action"] == HVACAction.IDLE
|
||||
assert state.attributes["preset_mode"] == HEATER_BIO_MODE
|
||||
|
@ -249,6 +249,6 @@ async def test_state_update(
|
|||
|
||||
await eheimdigital_hub_mock.call_args.kwargs["receive_callback"]()
|
||||
|
||||
assert (state := hass.states.get("climate.mock_heater_none"))
|
||||
assert (state := hass.states.get("climate.mock_heater"))
|
||||
assert state.state == HVACMode.OFF
|
||||
assert state.attributes["preset_mode"] == HEATER_SMART_MODE
|
||||
|
|
Loading…
Reference in New Issue