Skip to content

Commit 2f5f0df

Browse files
committed
Fix translation issue
1 parent d19b619 commit 2f5f0df

5 files changed

Lines changed: 6 additions & 5 deletions

File tree

custom_components/power_load_balancer/appliance_controller.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
CONF_DEVICE_COOLDOWN,
2020
DEFAULT_COOLDOWN_SECONDS,
2121
DOMAIN,
22+
ISSUE_TRANSLATION_KEY_DEVICE_UNAVAILABLE,
2223
)
2324
from .context_logger import ContextLogger
2425
from .exceptions import (
@@ -633,7 +634,7 @@ async def turn_off_appliance(self, entity_id: str, reason: str = "") -> None:
633634
f"{entity_id}_unavailable",
634635
is_fixable=False,
635636
severity=ir.IssueSeverity.ERROR,
636-
translation_key="device_unavailable",
637+
translation_key=ISSUE_TRANSLATION_KEY_DEVICE_UNAVAILABLE,
637638
translation_placeholders={"entity_id": entity_id},
638639
)
639640
if self._event_log_sensor:
@@ -791,7 +792,7 @@ async def turn_off_appliance_service(
791792
f"{entity_id}_unavailable",
792793
is_fixable=False,
793794
severity=ir.IssueSeverity.ERROR,
794-
translation_key="device_unavailable",
795+
translation_key=ISSUE_TRANSLATION_KEY_DEVICE_UNAVAILABLE,
795796
translation_placeholders={"entity_id": entity_id},
796797
)
797798
if self._event_log_sensor:

custom_components/power_load_balancer/const.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Constants for the Power Load Balancer integration."""
22

33
DOMAIN = "power_load_balancer"
4+
ISSUE_TRANSLATION_KEY_DEVICE_UNAVAILABLE = "device_unavailable"
45

56
CONF_MAIN_POWER_SENSOR = "main_power_sensor"
67
CONF_POWER_SENSORS = "power_sensors"

custom_components/power_load_balancer/power_balancer.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
DEVICE_MANUFACTURER,
3636
DEVICE_MODEL,
3737
DOMAIN,
38+
ISSUE_TRANSLATION_KEY_DEVICE_UNAVAILABLE,
3839
)
3940
from .context_logger import ContextLogger
4041
from .exceptions import ConfigurationError
@@ -233,7 +234,7 @@ def _mark_entity_unavailable(
233234
self._get_unavailable_issue_id(entity_id),
234235
is_fixable=False,
235236
severity=ir.IssueSeverity.WARNING,
236-
translation_key="device_unavailable",
237+
translation_key=ISSUE_TRANSLATION_KEY_DEVICE_UNAVAILABLE,
237238
translation_placeholders={"entity_id": entity_id},
238239
)
239240

custom_components/power_load_balancer/translations/en.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"device_unavailable": "Device {entity_id} is unavailable. Please check its connection or if its not used anymore remove it from the integration configuration",
32
"issues": {
43
"device_unavailable": {
54
"title": "Entity unavailable for balancing",

custom_components/power_load_balancer/translations/it.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"device_unavailable": "Il dispositivo {entity_id} non è disponibile. Controlla la sua connessione o, se non viene più utilizzato, rimuovilo dalla configurazione dell'integrazione.",
32
"issues": {
43
"device_unavailable": {
54
"title": "Entità non disponibile per il bilanciamento",

0 commit comments

Comments
 (0)