Skip to content

Commit 5a7d149

Browse files
committed
Add translation support for the new HAError raise
1 parent a9971ce commit 5a7d149

File tree

4 files changed

+44
-3
lines changed

4 files changed

+44
-3
lines changed

custom_components/plugwise/climate.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
from .entity import PlugwiseEntity
5555
from .util import plugwise_command
5656

57-
ERROR_NO_SCHEDULE = "Failed setting HVACMode, set a schedule first"
57+
ERROR_NO_SCHEDULE = "set_schedule_first"
5858
PARALLEL_UPDATES = 0
5959

6060

@@ -331,7 +331,10 @@ async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None:
331331

332332
# Enabling HVACMode.AUTO requires a previously set schedule for saving and restoring
333333
if hvac_mode == HVACMode.AUTO and not desired:
334-
raise HomeAssistantError(ERROR_NO_SCHEDULE)
334+
raise HomeAssistantError(
335+
translation_domain=DOMAIN,
336+
translation_key=ERROR_NO_SCHEDULE,
337+
)
335338

336339
await self.coordinator.api.set_schedule_state(
337340
self._location,

custom_components/plugwise/strings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,9 @@
318318
"invalid_xml_data": {
319319
"message": "Invalid XML data, or error indication received from the Plugwise Adam/Smile/Stretch"
320320
},
321+
"set_schedule_first": {
322+
"message": "Failed setting HVACMode, set a schedule first."
323+
},
321324
"unsupported_firmware": {
322325
"message": "Device with unsupported firmware"
323326
}

custom_components/plugwise/translations/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@
301301
"invalid_xml_data": {
302302
"message": "Invalid XML data, or error indication received from the Plugwise Adam/Smile/Stretch"
303303
},
304+
"set_schedule_first": {
305+
"message": "Failed setting HVACMode, set a schedule first."
306+
},
304307
"unsupported_firmware": {
305308
"message": "Device with unsupported firmware"
306309
}

custom_components/plugwise/translations/nl.json

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@
1818
},
1919
"config": {
2020
"step": {
21+
"reconfigure": {
22+
"description": "Configuratie bijwerken voor {title}.",
23+
"data": {
24+
"host": "IP-adres",
25+
"port": "Port nummer"
26+
}
27+
},
2128
"user": {
2229
"title": "Installeer Plugwise Adam/Smile/Stretch",
2330
"description": "Van uw Plugwise apparaat voer in: (installeren kan tot 90s duren)",
@@ -42,7 +49,9 @@
4249
},
4350
"abort": {
4451
"already_configured": "Dit apparaat is al geconfigureerd",
45-
"anna_with_adam": "Zowel Anna als Adam gedetecteerd. Voeg alleen de Adam toe, niet de Anna"
52+
"anna_with_adam": "Zowel Anna als Adam gedetecteerd. Voeg alleen de Adam toe, niet de Anna",
53+
"not_the_same_smile": "Het ingestelde Smile ID matcht niet met het ID van het ingegeven IP adres.",
54+
"reconfigure_successful": "Herconfigureren gelukt"
4655
}
4756
},
4857
"entity": {
@@ -291,6 +300,29 @@
291300
}
292301
}
293302
},
303+
"exceptions": {
304+
"authentication_failed": {
305+
"message": "Ongeldige authenticatie"
306+
},
307+
"data_incomplete_or_missing": {
308+
"message": "Data niet compleet of niet beschikbaar."
309+
},
310+
"error_communicating_with_api": {
311+
"message": "Fout bij het communiceren met API: {error}."
312+
},
313+
"failed_to_connect": {
314+
"message": "Verbinden mislukt"
315+
},
316+
"invalid_xml_data": {
317+
"message": "Ongeldige XML data, of foutmelding ontvangen van de Plugwise Adam/Smile/Stretch"
318+
},
319+
"set_schedule_first": {
320+
"message": "HVACMode aanpassing mislukt, aktiveer eerst een thermostaat schema."
321+
},
322+
"unsupported_firmware": {
323+
"message": "Apparaat met niet-ondersteunde firmware"
324+
}
325+
},
294326
"services": {
295327
"delete_notification": {
296328
"name": "Verwijder Plugwise notificatie",

0 commit comments

Comments
 (0)