Skip to content

Commit

Permalink
Actually use translated entity names in Lametric (#135381)
Browse files Browse the repository at this point in the history
  • Loading branch information
joostlek authored Jan 11, 2025
1 parent 0d85f54 commit 52c57eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
3 changes: 1 addition & 2 deletions homeassistant/components/lametric/number.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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)),
Expand Down
8 changes: 8 additions & 0 deletions homeassistant/components/lametric/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,14 @@
"name": "Dismiss all notifications"
}
},
"number": {
"brightness": {
"name": "Brightness"
},
"volume": {
"name": "Volume"
}
},
"sensor": {
"rssi": {
"name": "Wi-Fi signal"
Expand Down

0 comments on commit 52c57eb

Please sign in to comment.