From 52c57eb2e5f61e8bf5c1421e8761b7641954021d Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Sat, 11 Jan 2025 23:15:49 +0100 Subject: [PATCH] Actually use translated entity names in Lametric (#135381) --- homeassistant/components/lametric/number.py | 3 +-- homeassistant/components/lametric/strings.json | 8 ++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/lametric/number.py b/homeassistant/components/lametric/number.py index a1d922c2d80d8..0d299a2e93a91 100644 --- a/homeassistant/components/lametric/number.py +++ b/homeassistant/components/lametric/number.py @@ -33,7 +33,6 @@ class LaMetricNumberEntityDescription(NumberEntityDescription): LaMetricNumberEntityDescription( key="brightness", translation_key="brightness", - name="Brightness", entity_category=EntityCategory.CONFIG, native_step=1, native_min_value=0, @@ -45,11 +44,11 @@ class LaMetricNumberEntityDescription(NumberEntityDescription): LaMetricNumberEntityDescription( key="volume", translation_key="volume", - name="Volume", entity_category=EntityCategory.CONFIG, native_step=1, native_min_value=0, native_max_value=100, + native_unit_of_measurement=PERCENTAGE, has_fn=lambda device: bool(device.audio and device.audio.available), value_fn=lambda device: device.audio.volume if device.audio else 0, set_value_fn=lambda api, volume: api.audio(volume=int(volume)), diff --git a/homeassistant/components/lametric/strings.json b/homeassistant/components/lametric/strings.json index 0fd6f5a12dc1a..01e7823c76b5f 100644 --- a/homeassistant/components/lametric/strings.json +++ b/homeassistant/components/lametric/strings.json @@ -66,6 +66,14 @@ "name": "Dismiss all notifications" } }, + "number": { + "brightness": { + "name": "Brightness" + }, + "volume": { + "name": "Volume" + } + }, "sensor": { "rssi": { "name": "Wi-Fi signal"