From 52abab8ae812854e104f007304dca77a5efa64e4 Mon Sep 17 00:00:00 2001 From: Vincent Wolsink Date: Wed, 23 Jul 2025 11:28:28 +0200 Subject: [PATCH] Use translation_key for entities in Huum (#149256) --- homeassistant/components/huum/binary_sensor.py | 1 - homeassistant/components/huum/light.py | 2 +- homeassistant/components/huum/strings.json | 7 +++++++ tests/components/huum/snapshots/test_light.ambr | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/huum/binary_sensor.py b/homeassistant/components/huum/binary_sensor.py index a8e094dda94..7bc03e9fe94 100644 --- a/homeassistant/components/huum/binary_sensor.py +++ b/homeassistant/components/huum/binary_sensor.py @@ -27,7 +27,6 @@ async def async_setup_entry( class HuumDoorSensor(HuumBaseEntity, BinarySensorEntity): """Representation of a BinarySensor.""" - _attr_name = "Door" _attr_device_class = BinarySensorDeviceClass.DOOR def __init__(self, coordinator: HuumDataUpdateCoordinator) -> None: diff --git a/homeassistant/components/huum/light.py b/homeassistant/components/huum/light.py index 8eb35afdda2..9d3ec54101d 100644 --- a/homeassistant/components/huum/light.py +++ b/homeassistant/components/huum/light.py @@ -32,7 +32,7 @@ async def async_setup_entry( class HuumLight(HuumBaseEntity, LightEntity): """Representation of a light.""" - _attr_name = "Light" + _attr_translation_key = "light" _attr_supported_color_modes = {ColorMode.ONOFF} _attr_color_mode = ColorMode.ONOFF diff --git a/homeassistant/components/huum/strings.json b/homeassistant/components/huum/strings.json index 68ab1adde6f..55ccf0fdd81 100644 --- a/homeassistant/components/huum/strings.json +++ b/homeassistant/components/huum/strings.json @@ -18,5 +18,12 @@ "abort": { "already_configured": "[%key:common::config_flow::abort::already_configured_device%]" } + }, + "entity": { + "light": { + "light": { + "name": "[%key:component::light::title%]" + } + } } } diff --git a/tests/components/huum/snapshots/test_light.ambr b/tests/components/huum/snapshots/test_light.ambr index 918210272b2..da449c16fe8 100644 --- a/tests/components/huum/snapshots/test_light.ambr +++ b/tests/components/huum/snapshots/test_light.ambr @@ -33,7 +33,7 @@ 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': None, + 'translation_key': 'light', 'unique_id': 'AABBCC112233', 'unit_of_measurement': None, })