Skip to content

Commit 3a11d34

Browse files
authored
Merge pull request BenPru#413 from rhammen/translation_updates
Translation and code fixes for all hassfest errors, except "Error: R] [MANIFEST] Domain does not match dir name"
2 parents 732d737 + d34a1c2 commit 3a11d34

File tree

10 files changed

+1276
-1232
lines changed

10 files changed

+1276
-1232
lines changed

.github/workflows/hassfest.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
name: Validate with hassfest
22

33
on:
4-
schedule:
5-
- cron: "0 0 * * 0"
64
workflow_dispatch:
75

86
jobs:

custom_components/luxtronik/common.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,24 @@ def correct_key_value(
7272
sensor_id: str | LP | LC | LV,
7373
) -> Any:
7474
"""Handle special value corrections."""
75+
# fix 'states may not contain spaces ea for valid translations'
76+
if (
77+
sensor_id in [
78+
LC.C0080_STATUS,
79+
LC.C0117_STATUS_LINE_1,
80+
LC.C0119_STATUS_LINE_3,
81+
]
82+
):
83+
value = value.replace(' ','_').replace('/','_').lower()
84+
if (
85+
sensor_id in [
86+
LC.C0100_ERROR_REASON,
87+
# LP.P0716_0720_SWITCHOFF_REASON,
88+
]
89+
and ((value == -1) or (value == "-1"))
90+
):
91+
value = "minus_1"
92+
7593
if (
7694
sensor_id == LC.C0080_STATUS
7795
and value == LuxOperationMode.heating

custom_components/luxtronik/const.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
UPDATE_INTERVAL_VERY_SLOW: Final = timedelta(minutes=5)
3737

3838

39-
SECOUND_TO_HOUR_FACTOR: Final = 0.000277777777778
39+
SECOND_TO_HOUR_FACTOR: Final = (1/3600)
4040
# endregion Constants Main
4141

4242
# region Conf
@@ -124,12 +124,12 @@ class LuxOperationMode(StrEnum):
124124
"""Lux Operation modes heating, hot water etc."""
125125

126126
heating: Final = "heating" # 0
127-
domestic_water: Final = "hot water" # 1
128-
swimming_pool_solar: Final = "swimming pool/solar" # 2
127+
domestic_water: Final = "hot_water" # 1
128+
swimming_pool_solar: Final = "swimming_pool_solar" # 2
129129
evu: Final = "evu" # 3
130130
defrost: Final = "defrost" # 4
131-
no_request: Final = "no request" # 5
132-
heating_external_source: Final = "heating external source" # 6
131+
no_request: Final = "no_request" # 5
132+
heating_external_source: Final = "heating_external_source" # 6
133133
cooling: Final = "cooling" # 7
134134

135135

@@ -146,16 +146,16 @@ class LuxMode(StrEnum):
146146
class LuxStatus1Option(StrEnum):
147147
"""LuxStatus1 option defrost etc."""
148148

149-
heatpump_running: Final = "heatpump running"
150-
heatpump_idle: Final = "heatpump idle"
151-
heatpump_coming: Final = "heatpump coming"
152-
heatpump_shutdown: Final = "heatpump shutdown"
153-
errorcode_slot_zero: Final = "errorcode slot 0"
149+
heatpump_running: Final = "heatpump_running"
150+
heatpump_idle: Final = "heatpump_idle"
151+
heatpump_coming: Final = "heatpump_coming"
152+
heatpump_shutdown: Final = "heatpump_shutdown"
153+
errorcode_slot_zero: Final = "errorcode_slot_0"
154154
defrost: Final = "defrost"
155-
witing_on_LIN_connection: Final = "witing on LIN connection"
156-
compressor_heating_up: Final = "compressor heating up"
157-
pump_forerun: Final = "pump forerun"
158-
compressor_heater: Final = "compressor heater"
155+
waiting_on_lin_connection: Final = "witing_on_LIN_connection"
156+
compressor_heating_up: Final = "compressor_heating_up"
157+
pump_forerun: Final = "pump_forerun"
158+
compressor_heater: Final = "compressor_heater"
159159

160160

161161
class LuxStatus3Option(StrEnum):
@@ -164,23 +164,23 @@ class LuxStatus3Option(StrEnum):
164164
unknown: Final = ("unknown",)
165165
none: Final = ("none",)
166166
heating: Final = ("heating",)
167-
no_request: Final = ("no request",)
168-
grid_switch_on_delay: Final = ("grid switch on delay",)
169-
cycle_lock: Final = ("cycle lock",)
170-
lock_time: Final = ("lock time",)
171-
domestic_water: Final = ("domestic water",)
172-
info_bake_out_program: Final = ("info bake out program",)
167+
no_request: Final = ("no_request",)
168+
grid_switch_on_delay: Final = ("grid_switch_on_delay",)
169+
cycle_lock: Final = ("cycle_lock",)
170+
lock_time: Final = ("lock_time",)
171+
domestic_water: Final = ("domestic_water",)
172+
info_bake_out_program: Final = ("info_bake_out_program",)
173173
defrost: Final = ("defrost",)
174-
pump_forerun: Final = ("pump forerun",)
175-
thermal_desinfection: Final = ("thermal desinfection",)
174+
pump_forerun: Final = ("pump_forerun",)
175+
thermal_desinfection: Final = ("thermal_desinfection",)
176176
cooling: Final = ("cooling",)
177-
swimming_pool_solar: Final = ("swimming pool/solar",)
178-
heating_external_energy_source: Final = ("heating external energy source",)
177+
swimming_pool_solar: Final = ("swimming_pool_solar",)
178+
heating_external_energy_source: Final = ("heating_external_energy_source",)
179179
domestic_water_external_energy_source: Final = (
180-
"domestic water external energy source",
180+
"domestic_water_external_energy_source",
181181
)
182-
flow_monitoring: Final = ("flow monitoring",)
183-
second_heat_generator_1_active: Final = ("second heat generator 1 active",)
182+
flow_monitoring: Final = ("flow_monitoring",)
183+
second_heat_generator_1_active: Final = ("second_heat_generator_1_active",)
184184

185185

186186
class LuxMkTypes(Enum):

custom_components/luxtronik/manifest.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,14 @@
11
{
22
"domain": "luxtronik2",
33
"name": "Luxtronik",
4-
"config_flow": true,
5-
"documentation": "https://github.com/BenPru/luxtronik",
6-
"requirements": [
7-
"luxtronik==0.3.14",
8-
"requests>=2.28.2",
9-
"getmac==0.8.2",
10-
"packaging>=24.2"
11-
],
12-
"issue_tracker": "https://github.com/BenPru/luxtronik/issues",
13-
"dependencies": [
14-
"http"
15-
],
164
"after_dependencies": [],
175
"codeowners": [
186
"@BenPru"
197
],
20-
"iot_class": "local_polling",
21-
"version": "2025.7.20",
8+
"config_flow": true,
9+
"dependencies": [
10+
"http"
11+
],
2212
"dhcp": [
2313
{
2414
"macaddress": "000E8C*"
@@ -42,8 +32,18 @@
4232
"hostname": "wp-novelan"
4333
}
4434
],
35+
"documentation": "https://github.com/BenPru/luxtronik",
4536
"integration_type": "hub",
37+
"iot_class": "local_polling",
38+
"issue_tracker": "https://github.com/BenPru/luxtronik/issues",
4639
"loggers": [
4740
"luxtronik"
48-
]
41+
],
42+
"requirements": [
43+
"luxtronik==0.3.14",
44+
"requests>=2.28.2",
45+
"getmac==0.8.2",
46+
"packaging>=24.2"
47+
],
48+
"version": "2025.7.20"
4949
}

custom_components/luxtronik/sensor_entities_predefined.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
from .const import (
1717
LUX_STATE_ICON_MAP,
18-
SECOUND_TO_HOUR_FACTOR,
18+
SECOND_TO_HOUR_FACTOR,
1919
UPDATE_INTERVAL_NORMAL,
2020
UPDATE_INTERVAL_SLOW,
2121
UPDATE_INTERVAL_VERY_SLOW,
@@ -106,7 +106,7 @@
106106
entity_registry_visible_default=False,
107107
device_class=SensorDeviceClass.ENUM,
108108
options=[e.value for e in LuxStatus1Option],
109-
# translation_key="status1",
109+
# translation_key="status_line_1",
110110
),
111111
descr(
112112
key=SensorKey.STATUS_LINE_2,
@@ -116,7 +116,7 @@
116116
entity_registry_visible_default=False,
117117
device_class=SensorDeviceClass.ENUM,
118118
options=["since", "in"],
119-
# translation_key="status2",
119+
# translation_key="status_line_2",
120120
),
121121
descr(
122122
key=SensorKey.STATUS_LINE_3,
@@ -126,7 +126,7 @@
126126
entity_registry_visible_default=False,
127127
device_class=SensorDeviceClass.ENUM,
128128
options=[e.value for e in LuxStatus3Option],
129-
# translation_key="status3",
129+
# translation_key="status_line_3",
130130
),
131131
descr(
132132
key=SensorKey.HEAT_SOURCE_INPUT_TEMPERATURE,
@@ -175,7 +175,7 @@
175175
entity_category=EntityCategory.DIAGNOSTIC,
176176
native_unit_of_measurement=UnitOfTime.HOURS,
177177
visibility=LV.V0080_COMPRESSOR1_OPERATION_HOURS,
178-
factor=SECOUND_TO_HOUR_FACTOR,
178+
factor=SECOND_TO_HOUR_FACTOR,
179179
native_precision=2,
180180
update_interval=UPDATE_INTERVAL_VERY_SLOW,
181181
),
@@ -197,7 +197,7 @@
197197
entity_category=EntityCategory.DIAGNOSTIC,
198198
native_unit_of_measurement=UnitOfTime.HOURS,
199199
visibility=LV.V0083_COMPRESSOR2_OPERATION_HOURS,
200-
factor=SECOUND_TO_HOUR_FACTOR,
200+
factor=SECOND_TO_HOUR_FACTOR,
201201
native_precision=2,
202202
update_interval=UPDATE_INTERVAL_VERY_SLOW,
203203
),
@@ -208,7 +208,7 @@
208208
state_class=SensorStateClass.TOTAL_INCREASING,
209209
entity_category=EntityCategory.DIAGNOSTIC,
210210
native_unit_of_measurement=UnitOfTime.HOURS,
211-
factor=SECOUND_TO_HOUR_FACTOR,
211+
factor=SECOND_TO_HOUR_FACTOR,
212212
native_precision=2,
213213
update_interval=UPDATE_INTERVAL_VERY_SLOW,
214214
),
@@ -327,7 +327,7 @@
327327
entity_category=EntityCategory.DIAGNOSTIC,
328328
native_unit_of_measurement=UnitOfTime.HOURS,
329329
visibility=LV.V0086_ADDITIONAL_HEAT_GENERATOR_OPERATION_HOURS,
330-
factor=SECOUND_TO_HOUR_FACTOR,
330+
factor=SECOND_TO_HOUR_FACTOR,
331331
native_precision=2,
332332
update_interval=UPDATE_INTERVAL_VERY_SLOW,
333333
),
@@ -339,7 +339,7 @@
339339
entity_category=EntityCategory.DIAGNOSTIC,
340340
native_unit_of_measurement=UnitOfTime.HOURS,
341341
visibility=LV.V0087_ADDITIONAL_HEAT_GENERATOR2_OPERATION_HOURS,
342-
factor=SECOUND_TO_HOUR_FACTOR,
342+
factor=SECOND_TO_HOUR_FACTOR,
343343
native_precision=2,
344344
update_interval=UPDATE_INTERVAL_VERY_SLOW,
345345
),
@@ -597,7 +597,7 @@
597597
state_class=SensorStateClass.TOTAL_INCREASING,
598598
entity_category=EntityCategory.DIAGNOSTIC,
599599
native_unit_of_measurement=UnitOfTime.HOURS,
600-
factor=SECOUND_TO_HOUR_FACTOR,
600+
factor=SECOND_TO_HOUR_FACTOR,
601601
native_precision=2,
602602
update_interval=UPDATE_INTERVAL_VERY_SLOW,
603603
),
@@ -679,7 +679,7 @@
679679
icon="mdi:timer-sand",
680680
state_class=SensorStateClass.TOTAL_INCREASING,
681681
native_unit_of_measurement=UnitOfTime.HOURS,
682-
factor=SECOUND_TO_HOUR_FACTOR,
682+
factor=SECOND_TO_HOUR_FACTOR,
683683
native_precision=2,
684684
update_interval=UPDATE_INTERVAL_VERY_SLOW,
685685
),
@@ -737,7 +737,7 @@
737737
state_class=SensorStateClass.TOTAL_INCREASING,
738738
entity_category=EntityCategory.DIAGNOSTIC,
739739
native_unit_of_measurement=UnitOfTime.HOURS,
740-
factor=SECOUND_TO_HOUR_FACTOR,
740+
factor=SECOND_TO_HOUR_FACTOR,
741741
native_precision=2,
742742
visibility=LV.V0038_SOLAR_COLLECTOR,
743743
update_interval=UPDATE_INTERVAL_VERY_SLOW,
@@ -752,7 +752,7 @@
752752
state_class=SensorStateClass.TOTAL_INCREASING,
753753
entity_category=EntityCategory.DIAGNOSTIC,
754754
native_unit_of_measurement=UnitOfTime.HOURS,
755-
factor=SECOUND_TO_HOUR_FACTOR,
755+
factor=SECOND_TO_HOUR_FACTOR,
756756
native_precision=2,
757757
update_interval=UPDATE_INTERVAL_VERY_SLOW,
758758
),

0 commit comments

Comments
 (0)