Skip to content

Commit e709290

Browse files
committed
Add missing translation strings for all translatable entities
Add translation entries for sensor.state, binary_sensor.fault, and switch.rain_delay. Also add translation_key to rain delay switch description and fix _attr_name init order to prevent platform_data resolution error.
1 parent 589394e commit e709290

2 files changed

Lines changed: 18 additions & 2 deletions

File tree

custom_components/bhyve/strings.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,12 +147,22 @@
147147
"temperature_alert": {
148148
"name": "Temperature alert",
149149
"state": {
150-
"on": "Problem detected",
150+
"on": "Problem",
151+
"off": "OK"
152+
}
153+
},
154+
"fault": {
155+
"name": "Fault",
156+
"state": {
157+
"on": "Fault",
151158
"off": "OK"
152159
}
153160
}
154161
},
155162
"sensor": {
163+
"state": {
164+
"name": "State"
165+
},
156166
"temperature": {
157167
"name": "Temperature"
158168
},
@@ -162,6 +172,11 @@
162172
"signal_strength": {
163173
"name": "Signal strength"
164174
}
175+
},
176+
"switch": {
177+
"rain_delay": {
178+
"name": "Rain delay"
179+
}
165180
}
166181
}
167182
}

custom_components/bhyve/switch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ async def async_setup_entry(
123123
device,
124124
BHyveSwitchEntityDescription(
125125
key="rain_delay",
126+
translation_key="rain_delay",
126127
name="Rain delay",
127128
icon="mdi:weather-pouring",
128129
entity_category=EntityCategory.CONFIG,
@@ -267,10 +268,10 @@ def __init__(
267268
) -> None:
268269
"""Initialize the switch."""
269270
self.entity_description = description
271+
self._attr_name = description.name
270272

271273
super().__init__(coordinator, device)
272274

273-
self._attr_name = description.name
274275
self._attr_unique_id = f"{self._mac_address}:{self._device_id}:rain_delay"
275276

276277
@property

0 commit comments

Comments
 (0)