Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for "translation_key contains invalid characters" errors in hassfest #171

Open
wants to merge 30 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c759fbe
Update hassfest.yaml
rhammen Oct 22, 2023
6243028
Update validate-hacs.yaml
rhammen Oct 22, 2023
55cbb62
Merge branch 'BenPru:main' into improve-Beta-integration
rhammen Oct 22, 2023
1182a2b
Attempt to fix translations issues
rhammen Oct 22, 2023
a109bbb
More fixes translation issues
rhammen Oct 22, 2023
d6e7f36
Update en.json
rhammen Oct 22, 2023
b3137ba
Update en.json
rhammen Oct 23, 2023
55ad84a
Update common.py to get valid 'states' to translate
rhammen Oct 23, 2023
8b5d948
Update en.json
rhammen Oct 23, 2023
0facafb
Changes realted to changed state-values for translation_keys
rhammen Oct 23, 2023
caebeb1
Prepare addition of Switchoff reason sensor
rhammen Oct 23, 2023
449b363
Update en.json
rhammen Oct 25, 2023
c4ab4d2
Update de.json to get translation keys without spaces
rhammen Oct 25, 2023
3460141
Update en.json
rhammen Oct 25, 2023
b033cdf
Update pl.json to get translation keys without spaces
rhammen Oct 25, 2023
6c029f4
Update pl.json
rhammen Oct 25, 2023
6d0c270
Update pl.json
rhammen Oct 25, 2023
1492a19
Merge pull request #7 from BenPru/main
rhammen Oct 25, 2023
71ff552
Update pl.json to get translation keys without spaces
rhammen Oct 25, 2023
fcce0c9
Update en.json
rhammen Oct 25, 2023
28d0462
Update de.json
rhammen Oct 25, 2023
280df22
Update pl.json
rhammen Oct 25, 2023
e31b327
Update manifest.json - remove not allowed key "homeassistant"
rhammen Oct 25, 2023
2212658
Update manifest.json
rhammen Oct 26, 2023
d5417a4
Update climate.py
rhammen Oct 26, 2023
5171d6b
Update const.py
rhammen Oct 26, 2023
3c03035
Update update.py
rhammen Oct 26, 2023
44d44ce
Update manifest.json
rhammen Oct 26, 2023
a7f8528
Merge pull request #8 from BenPru/main
rhammen Oct 26, 2023
eca1990
Update manifest.json
rhammen Oct 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/hassfest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ name: Validate with hassfest
on:
push:
pull_request:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:

jobs:
validate:
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/validate-hacs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ name: HACS Action
on:
push:
pull_request:
schedule:
- cron: "0 0 * * *"
workflow_dispatch:

jobs:
Expand Down
17 changes: 17 additions & 0 deletions custom_components/luxtronik/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,23 @@ def correct_key_value(
sensor_id: str | LP | LC | LV,
) -> Any:
"""Handle special value corrections."""
if (
sensor_id in [
LC.C0080_STATUS,
LC.C0117_STATUS_LINE_1,
LC.C0119_STATUS_LINE_3,
]
):
value = value.replace(' ','_').replace('/','_').lower()
if (
sensor_id in [
LC.C0100_ERROR_REASON,
LC.C0106_SWITCHOFF_REASON,
]
and value == -1
):
value = 99999

if (
sensor_id == LC.C0080_STATUS
and value == LuxOperationMode.heating
Expand Down
55 changes: 29 additions & 26 deletions custom_components/luxtronik/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ class LuxOperationMode(StrEnum):
"""Lux Operation modes heating, hot water etc."""

heating: Final = "heating" # 0
domestic_water: Final = "hot water" # 1
swimming_pool_solar: Final = "swimming pool/solar" # 2
domestic_water: Final = "hot_water" # 1
swimming_pool_solar: Final = "swimming_pool_solar" # 2
evu: Final = "evu" # 3
defrost: Final = "defrost" # 4
no_request: Final = "no request" # 5
heating_external_source: Final = "heating external source" # 6
no_request: Final = "no_request" # 5
heating_external_source: Final = "heating_external_source" # 6
cooling: Final = "cooling" # 7


Expand All @@ -125,16 +125,16 @@ class LuxMode(StrEnum):
class LuxStatus1Option(StrEnum):
"""LuxStatus1 option defrost etc."""

heatpump_running: Final = "heatpump running"
heatpump_idle: Final = "heatpump idle"
heatpump_coming: Final = "heatpump coming"
heatpump_shutdown: Final = "heatpump shutdown"
errorcode_slot_zero: Final = "errorcode slot 0"
heatpump_running: Final = "heatpump_running"
heatpump_idle: Final = "heatpump_idle"
heatpump_coming: Final = "heatpump_coming"
heatpump_shutdown: Final = "heatpump_shutdown"
errorcode_slot_zero: Final = "errorcode_slot_0"
defrost: Final = "defrost"
witing_on_LIN_connection: Final = "witing on LIN connection"
compressor_heating_up: Final = "compressor heating up"
pump_forerun: Final = "pump forerun"
compressor_heater: Final = "compressor heater"
writing_on_lin_connection: Final = "writing_on_lin_connection"
compressor_heating_up: Final = "compressor_heating_up"
pump_forerun: Final = "pump_forerun"
compressor_heater: Final = "compressor_heater"


class LuxStatus3Option(StrEnum):
Expand All @@ -143,23 +143,23 @@ class LuxStatus3Option(StrEnum):
unknown: Final = ("unknown",)
none: Final = ("none",)
heating: Final = ("heating",)
no_request: Final = ("no request",)
grid_switch_on_delay: Final = ("grid switch on delay",)
cycle_lock: Final = ("cycle lock",)
lock_time: Final = ("lock time",)
domestic_water: Final = ("domestic water",)
info_bake_out_program: Final = ("info bake out program",)
no_request: Final = ("no_request",)
grid_switch_on_delay: Final = ("grid_switch_on_delay",)
cycle_lock: Final = ("cycle_lock",)
lock_time: Final = ("lock_time",)
domestic_water: Final = ("domestic_water",)
info_bake_out_program: Final = ("info_bake_out_program",)
defrost: Final = ("defrost",)
pump_forerun: Final = ("pump forerun",)
thermal_desinfection: Final = ("thermal desinfection",)
pump_forerun: Final = ("pump_forerun",)
thermal_desinfection: Final = ("thermal_desinfection",)
cooling: Final = ("cooling",)
swimming_pool_solar: Final = ("swimming pool/solar",)
heating_external_energy_source: Final = ("heating external energy source",)
swimming_pool_solar: Final = ("swimming_pool_solar",)
heating_external_energy_source: Final = ("heating_external_energy_source",)
domestic_water_external_energy_source: Final = (
"domestic water external energy source",
"domestic_water_external_energy_source",
)
flow_monitoring: Final = ("flow monitoring",)
second_heat_generator_1_active: Final = ("second heat generator 1 active",)
flow_monitoring: Final = ("flow_monitoring",)
second_heat_generator_1_active: Final = ("second_heat_generator_1_active",)


class LuxMkTypes(Enum):
Expand Down Expand Up @@ -412,6 +412,8 @@ class LuxCalculation(StrEnum):
C0100_ERROR_REASON: Final = "calculations.ID_WEB_ERROR_Nr0"
# TODO: !
# C0105_ERROR_COUNTER: Final = "calculations.ID_WEB_AnzahlFehlerInSpeicher"
C0106_SWITCHOFF_REASON: Final = "calculations.ID_WEB_Switchoff_file_Nr0"
C0111_SWITCHOFF_TIME: Final = "calculations.ID_WEB_Switchoff_file_Time0"
C0117_STATUS_LINE_1: Final = "calculations.ID_WEB_HauptMenuStatus_Zeile1"
C0118_STATUS_LINE_2: Final = "calculations.ID_WEB_HauptMenuStatus_Zeile2"
C0119_STATUS_LINE_3: Final = "calculations.ID_WEB_HauptMenuStatus_Zeile3"
Expand Down Expand Up @@ -559,6 +561,7 @@ class SensorKey(StrEnum):
CIRCULATION_PUMP_DELTA = "circulation_pump_delta"
HEAT_SOURCE_OUTPUT_TEMPERATURE = "heat_source_output_temperature"
ERROR_REASON = "error_reason"
SWITCHOFF_REASON = "switchoff_reason"
FLOW_IN_TEMPERATURE = "flow_in_temperature"
FLOW_OUT_TEMPERATURE = "flow_out_temperature"
FLOW_OUT_TEMPERATURE_TARGET = "flow_out_temperature_target"
Expand Down
1 change: 0 additions & 1 deletion custom_components/luxtronik/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
"codeowners": ["@BenPru"],
"iot_class": "local_polling",
"version": "2023.10.26",
"homeassistant": "2023.1.0",
"dhcp": [
{ "macaddress": "000E8C*" },
{ "macaddress": "001999*" },
Expand Down
9 changes: 5 additions & 4 deletions custom_components/luxtronik/sensor_entities_predefined.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
],
options=[e.value for e in LuxOperationMode],
update_interval=UPDATE_INTERVAL_NORMAL,
translation_key="status",
),
]

Expand Down Expand Up @@ -89,8 +90,8 @@
icon="mdi:numeric-1-circle",
entity_registry_visible_default=False,
device_class=SensorDeviceClass.ENUM,
options=[e.value for e in LuxStatus1Option]
# translation_key="status1",
options=[e.value for e in LuxStatus1Option],
translation_key="status_line_1",
),
descr(
key=SensorKey.STATUS_LINE_2,
Expand All @@ -100,7 +101,7 @@
entity_registry_visible_default=False,
device_class=SensorDeviceClass.ENUM,
options=["since", "in"],
# translation_key="status2",
translation_key="status_line_2",
),
descr(
key=SensorKey.STATUS_LINE_3,
Expand All @@ -110,7 +111,7 @@
entity_registry_visible_default=False,
device_class=SensorDeviceClass.ENUM,
options=[e.value for e in LuxStatus3Option],
# translation_key="status3",
translation_key="status_line_3",
),
descr(
key=SensorKey.HEAT_SOURCE_INPUT_TEMPERATURE,
Expand Down
58 changes: 29 additions & 29 deletions custom_components/luxtronik/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,13 +207,13 @@
"name": "Status",
"state": {
"heating": "Heizt",
"hot water": "Brauchwasser",
"swimming pool/solar": "Pool / Solar",
"hot_water": "Brauchwasser",
"swimming_pool_solar": "Pool / Solar",
"evu": "Netzsperre",
"defrost": "Abtauen",
"heating external source": "Heizt aus externer Quelle",
"heating_external_source": "Heizt aus externer Quelle",
"cooling": "K\u00fchlen",
"no request": "Leerlauf (keine Anforderung)"
"no_request": "Leerlauf (keine Anforderung)"
},
"state_attributes": {
"evu_text": {
Expand Down Expand Up @@ -300,7 +300,7 @@
"791": "ModBus Verbindung verloren",
"792": "LIN-Verbindung unterbrochen",
"793": "Schwerw. Inverter Fehler",
"-1": "Unbekannter Fehler"
"99999": "Unbekannter Fehler"
},
"state_attributes": {
"timestamp": {
Expand Down Expand Up @@ -382,7 +382,7 @@
"791": "SEC-Board seit einiger Zeit nicht mehr erreichbar. 791 wird ausgel\u00f6st, wenn zwar eine HZIO-Platine gefunden worden ist \u0028ohne separate Kodierung\u0029, allerdings kein SEC-Board daran erkannt werden kann.",
"792": "Es konnte keine Grundplatine und auch sonst keine Konfiguration gefunden werden.",
"793": "Temperaturfehler im Inverter",
"-1": "Unbekannter Fehler"
"99999": "Unbekannter Fehler"
}
},
"remedy": {
Expand Down Expand Up @@ -479,22 +479,22 @@
"8": "Untere Einsatzgrenze",
"9": "Keine Anforderung",
"11": "Durchfluss-W\u00e4rmequelle",
"-1": "Unbekannte Abschaltung"
"99999": "Unbekannte Abschaltung"
}
},
"status_line_1": {
"name": "Status 1",
"state": {
"heatpump running": "Die W\u00e4rmepumpe l\u00e4uft",
"heatpump idle": "Die W\u00e4rmepumpe ist im Leerlauf",
"heatpump coming": "Die W\u00e4rmepumpe startet",
"heatpump shutdown": "Die W\u00e4rmepumpe schaltet ab",
"errorcode slot": "W\u00e4rmepumpe Fehlercode in Schacht 0",
"pump forerun": "Pumpenvorlauf",
"heatpump_running": "Die W\u00e4rmepumpe l\u00e4uft",
"heatpump_idle": "Die W\u00e4rmepumpe ist im Leerlauf",
"heatpump_coming": "Die W\u00e4rmepumpe startet",
"heatpump_shutdown": "Die W\u00e4rmepumpe schaltet ab",
"errorcode_slot_0": "W\u00e4rmepumpe Fehlercode in Schacht 0",
"pump_forerun": "Pumpenvorlauf",
"defrost": "Taut ab",
"witing on LIN connection": "Schreibt auf LIN Verbindung",
"compressor heating up": "Der Verdichter heizt auf",
"compressor heater": "Verdichter-Heizung"
"writing_on_lin_connection": "Schreibt auf LIN Verbindung",
"compressor_heating_up": "Der Verdichter heizt auf",
"compressor_heater": "Verdichter-Heizung"
}
},
"status_line_2": {
Expand All @@ -511,19 +511,19 @@
"heating": "heizt",
"defrost": "abtauen",
"cooling": "k\u00fchlen",
"pump forerun": "Pumpenvorlauf",
"thermal desinfection": "thermische Desinfektion",
"swimming pool/solar": "Pool / Solar",
"no request": "keine Anforderung",
"cycle lock": "Einschaltsperre",
"lock time": "Sperrzeit",
"domestic water": "Brauchwasser",
"flow monitoring": "Durchfluss\u00fcberwachung",
"grid switch on delay": "Verz\u00f6gerung beim Einschalten des Netzes",
"info bake out program": "Information aus Aufheizprogramm",
"heating external engery source": "heizen aus externer Energiequelle",
"domestic water external energy source": "Brauchwasser aus externer Energiequelle",
"second heat generator 1 active": "zweiter W\u00e4rmeerzeuger 1 aktiv"
"pump_forerun": "Pumpenvorlauf",
"thermal_desinfection": "thermische Desinfektion",
"swimming_pool_solar": "Pool / Solar",
"no_request": "keine Anforderung",
"cycle_lock": "Einschaltsperre",
"lock_time": "Sperrzeit",
"domestic_water": "Brauchwasser",
"flow_monitoring": "Durchfluss\u00fcberwachung",
"grid_switch_on_delay": "Verz\u00f6gerung beim Einschalten des Netzes",
"info_bake_out_program": "Information aus Aufheizprogramm",
"heating_external_energy_source": "heizen aus externer Energiequelle",
"domestic_water_external_energy_source": "Brauchwasser aus externer Energiequelle",
"second_heat_generator_1_active": "zweiter W\u00e4rmeerzeuger 1 aktiv"
}
},
"heat_source_output": {
Expand Down
Loading
Loading