Skip to content

Commit 0ac2da9

Browse files
AJediIAmgithub-actions[bot]
authored andcommitted
chore: format code with ruff
1 parent 3a11d34 commit 0ac2da9

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

custom_components/luxtronik/common.py

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,18 @@ def correct_key_value(
7373
) -> Any:
7474
"""Handle special value corrections."""
7575
# fix 'states may not contain spaces ea for valid translations'
76-
if (
77-
sensor_id in [
76+
if sensor_id in [
7877
LC.C0080_STATUS,
7978
LC.C0117_STATUS_LINE_1,
8079
LC.C0119_STATUS_LINE_3,
81-
]
82-
):
83-
value = value.replace(' ','_').replace('/','_').lower()
84-
if (
85-
sensor_id in [
80+
]:
81+
value = value.replace(" ", "_").replace("/", "_").lower()
82+
if sensor_id in [
8683
LC.C0100_ERROR_REASON,
8784
# LP.P0716_0720_SWITCHOFF_REASON,
88-
]
89-
and ((value == -1) or (value == "-1"))
90-
):
85+
] and ((value == -1) or (value == "-1")):
9186
value = "minus_1"
92-
87+
9388
if (
9489
sensor_id == LC.C0080_STATUS
9590
and value == LuxOperationMode.heating

custom_components/luxtronik/const.py

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

3838

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

4242
# region Conf

custom_components/luxtronik/sensor_entities_predefined.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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="status_line_1",
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="status_line_2",
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="status_line_3",
129+
# translation_key="status_line_3",
130130
),
131131
descr(
132132
key=SensorKey.HEAT_SOURCE_INPUT_TEMPERATURE,

0 commit comments

Comments
 (0)