Skip to content

Commit 11685a3

Browse files
rhammengithub-actions[bot]
authored andcommitted
chore: format code with ruff
1 parent b986a1a commit 11685a3

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

custom_components/luxtronik/common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@
2828

2929
# endregion Imports
3030

31-
def key_exists(coordinator: LuxtronikCoordinatorData, luxtronik_key: str | LP | LC | LV) -> bool:
31+
32+
def key_exists(
33+
coordinator: LuxtronikCoordinatorData, luxtronik_key: str | LP | LC | LV
34+
) -> bool:
3235
"""Check if the given Luxtronik key exists in the coordinator's data by matching item.name."""
3336
try:
3437
key_str = str(luxtronik_key)
@@ -57,6 +60,7 @@ def key_exists(coordinator: LuxtronikCoordinatorData, luxtronik_key: str | LP |
5760
LOGGER.error("Error checking key existence: %s", e)
5861
return False
5962

63+
6064
def get_sensor_data(
6165
coordinator: LuxtronikCoordinatorData,
6266
luxtronik_key: str | LP | LC | LV,

custom_components/luxtronik/coordinator.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,6 @@ def device_key_active(self, device_key: DeviceKey) -> bool:
398398
# return self.detect_cooling_present()
399399
raise NotImplementedError
400400

401-
402401
@property
403402
def has_heating(self) -> bool:
404403
"""Is heating activated."""

custom_components/luxtronik/switch.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@ async def async_setup_entry(
3838
raise ConfigEntryNotReady
3939

4040
unavailable_keys = [
41-
i.luxtronik_key for i in SWITCHES if not key_exists(coordinator.data, i.luxtronik_key)
41+
i.luxtronik_key
42+
for i in SWITCHES
43+
if not key_exists(coordinator.data, i.luxtronik_key)
4244
]
4345
if unavailable_keys:
4446
LOGGER.warning("Not present in Luxtronik data, skipping: %s", unavailable_keys)

custom_components/luxtronik/water_heater.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ def max_temp(self) -> float:
177177
"""Return the maximum temperature allowed."""
178178
try:
179179
if key_exists(self.coordinator.data, LP.P0973_MAX_DHW_TEMPERATURE):
180-
value = get_sensor_data(self.coordinator.data, LP.P0973_MAX_DHW_TEMPERATURE)
180+
value = get_sensor_data(
181+
self.coordinator.data, LP.P0973_MAX_DHW_TEMPERATURE
182+
)
181183
return float(value)
182184
except (TypeError, ValueError):
183185
return 60.0 # fallback default

0 commit comments

Comments
 (0)