Use translation_key for entities in Huum (#149256)

This commit is contained in:
Vincent Wolsink 2025-07-23 11:28:28 +02:00 committed by GitHub
parent 7aa4810b0a
commit 52abab8ae8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 3 deletions

View File

@ -27,7 +27,6 @@ async def async_setup_entry(
class HuumDoorSensor(HuumBaseEntity, BinarySensorEntity): class HuumDoorSensor(HuumBaseEntity, BinarySensorEntity):
"""Representation of a BinarySensor.""" """Representation of a BinarySensor."""
_attr_name = "Door"
_attr_device_class = BinarySensorDeviceClass.DOOR _attr_device_class = BinarySensorDeviceClass.DOOR
def __init__(self, coordinator: HuumDataUpdateCoordinator) -> None: def __init__(self, coordinator: HuumDataUpdateCoordinator) -> None:

View File

@ -32,7 +32,7 @@ async def async_setup_entry(
class HuumLight(HuumBaseEntity, LightEntity): class HuumLight(HuumBaseEntity, LightEntity):
"""Representation of a light.""" """Representation of a light."""
_attr_name = "Light" _attr_translation_key = "light"
_attr_supported_color_modes = {ColorMode.ONOFF} _attr_supported_color_modes = {ColorMode.ONOFF}
_attr_color_mode = ColorMode.ONOFF _attr_color_mode = ColorMode.ONOFF

View File

@ -18,5 +18,12 @@
"abort": { "abort": {
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]" "already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
} }
},
"entity": {
"light": {
"light": {
"name": "[%key:component::light::title%]"
}
}
} }
} }

View File

@ -33,7 +33,7 @@
'previous_unique_id': None, 'previous_unique_id': None,
'suggested_object_id': None, 'suggested_object_id': None,
'supported_features': 0, 'supported_features': 0,
'translation_key': None, 'translation_key': 'light',
'unique_id': 'AABBCC112233', 'unique_id': 'AABBCC112233',
'unit_of_measurement': None, 'unit_of_measurement': None,
}) })