Skip to content

Commit dfc7e10

Browse files
rhammengithub-actions[bot]
authored andcommitted
chore: format code with ruff
1 parent 3e12bbf commit dfc7e10

File tree

5 files changed

+24
-28
lines changed

5 files changed

+24
-28
lines changed

custom_components/luxtronik/const.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ class UnitOfVolumeFlowRateExt(StrEnum):
8888
class DeviceKey(StrEnum):
8989
"""Device keys."""
9090

91-
heatpump: Final = "heatpump"
91+
heatpump: Final = "heatpump"
9292
heating: Final = "heating"
9393
domestic_water: Final = "domestic_water"
9494
cooling: Final = "cooling"
@@ -286,6 +286,7 @@ class LuxDaySelectorParameter(StrEnum):
286286
SATURDAY: Final = "parameters.ID_Einst_BwTDI_akt_SA"
287287
SUNDAY: Final = "parameters.ID_Einst_BwTDI_akt_SO"
288288

289+
289290
DAY_NAME_TO_PARAM: Final[dict[str, LuxDaySelectorParameter]] = {
290291
"Monday": LuxDaySelectorParameter.MONDAY,
291292
"Tuesday": LuxDaySelectorParameter.TUESDAY,
@@ -466,6 +467,7 @@ class LuxParameter(StrEnum):
466467
P0732_AWAY_DHW_STARTDATE: Final = "parameters.ID_SU_FstdBw"
467468
P0007_AWAY_DHW_ENDDATE: Final = "parameters.ID_SU_FrkdBw"
468469

470+
469471
# endregion Lux parameters
470472

471473
LUX_PARAMETER_MK_SENSORS: Final = [

custom_components/luxtronik/date.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from homeassistant.core import HomeAssistant, callback
88
from homeassistant.exceptions import ConfigEntryNotReady
99
from homeassistant.helpers.entity_platform import AddEntitiesCallback
10-
from homeassistant.util import dt as dt_util
1110

1211
from .base import LuxtronikEntity
1312
from .common import get_sensor_data, key_exists
@@ -22,6 +21,7 @@
2221
from .date_entities_predefined import CALENDAR_ENTITIES
2322
from .model import LuxtronikDateEntityDescription
2423

24+
2525
async def async_setup_entry(
2626
hass: HomeAssistant, entry: ConfigEntry, async_add_entities: AddEntitiesCallback
2727
) -> None:
@@ -56,6 +56,7 @@ async def async_setup_entry(
5656
True,
5757
)
5858

59+
5960
class LuxtronikDateEntity(LuxtronikEntity, DateEntity):
6061
"""Luxtronik Date Entity that supports user-editable dates."""
6162

@@ -103,13 +104,11 @@ def _handle_coordinator_update(
103104
self.async_write_ha_state()
104105
super()._handle_coordinator_update()
105106

106-
107107
async def async_set_value(self, value: date) -> None:
108108
"""Handle user-set date from the UI."""
109109
self._attr_native_value = value
110110
timestamp = int(datetime.combine(value, datetime.min.time()).timestamp())
111111
await self.coordinator.async_write(
112-
self.entity_description.luxtronik_key.value.split(".")[1],
113-
timestamp
112+
self.entity_description.luxtronik_key.value.split(".")[1], timestamp
114113
)
115114
self.async_write_ha_state()

custom_components/luxtronik/date_entities_predefined.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1-
2-
31
from homeassistant.helpers.entity import EntityCategory
42

53
from .const import (
64
DeviceKey,
7-
LuxCalculation as LC,
85
LuxParameter as LP,
9-
LuxVisibility as LV,
106
SensorKey as SK,
117
)
128
from .model import (
13-
LuxtronikEntityAttributeDescription as attr,
149
LuxtronikDateEntityDescription,
1510
)
1611

1712

18-
CALENDAR_ENTITIES: list[LuxtronikDateEntityDescription] = [
13+
CALENDAR_ENTITIES: list[LuxtronikDateEntityDescription] = [
1914
LuxtronikDateEntityDescription(
2015
key=SK.AWAY_DHW_STARTDATE,
2116
luxtronik_key=LP.P0732_AWAY_DHW_STARTDATE,

custom_components/luxtronik/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,4 +230,4 @@ class LuxtronikDateEntityDescription(
230230
):
231231
"""Class describing Luxtronik date entities."""
232232

233-
platform = Platform.DATE
233+
platform = Platform.DATE

custom_components/luxtronik/select.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""Support for Luxtronik selectors"""
22

3-
from homeassistant.components.binary_sensor import ENTITY_ID_FORMAT, BinarySensorEntity
3+
from homeassistant.components.binary_sensor import ENTITY_ID_FORMAT
44
from homeassistant.components.select import SelectEntity
55
from homeassistant.config_entries import ConfigEntry
66
from homeassistant.core import HomeAssistant, callback
@@ -13,13 +13,13 @@
1313
from .common import get_sensor_data
1414
from .const import (
1515
DAY_SELECTOR_OPTIONS,
16-
DOMAIN,
17-
CONF_COORDINATOR,
18-
CONF_HA_SENSOR_PREFIX,
19-
LuxDaySelectorParameter,
16+
DOMAIN,
17+
CONF_COORDINATOR,
18+
CONF_HA_SENSOR_PREFIX,
19+
LuxDaySelectorParameter,
2020
DAY_NAME_TO_PARAM,
2121
DeviceKey,
22-
SensorKey as SK
22+
SensorKey as SK,
2323
)
2424
from .coordinator import LuxtronikCoordinator, LuxtronikCoordinatorData
2525
from .model import LuxtronikEntityDescription
@@ -44,28 +44,29 @@ async def async_setup_entry(
4444
key=SK.THERMAL_DESINFECTION_DAY,
4545
device_key=DeviceKey.domestic_water,
4646
luxtronik_key=LuxDaySelectorParameter.MONDAY, # Just one valid key for metadata
47-
)
47+
)
4848
async_add_entities(
4949
[
5050
LuxtronikThermalDesinfectionDaySelector(
51-
entry, coordinator,description, description.device_key
51+
entry, coordinator, description, description.device_key
5252
)
53-
],
54-
True
53+
],
54+
True,
5555
)
5656

5757

5858
class LuxtronikThermalDesinfectionDaySelector(LuxtronikEntity, SelectEntity):
5959
"""Luxtronik Thermal Desinfection Day Selector Entity."""
60+
6061
def __init__(
61-
self,
62+
self,
6263
entry: ConfigEntry,
6364
coordinator: LuxtronikCoordinator,
6465
description: LuxtronikEntityDescription,
6566
device_info_ident: DeviceKey,
66-
):
67+
):
6768
# No description needed for this custom entity
68-
69+
6970
super().__init__(
7071
coordinator=coordinator,
7172
description=description,
@@ -89,7 +90,7 @@ def _handle_coordinator_update(
8990
"""Handle updated data from the coordinator."""
9091
# if not self.should_update():
9192
# return
92-
93+
9394
super()._handle_coordinator_update()
9495
data = self.coordinator.data if data is None else data
9596
if data is None:
@@ -107,7 +108,6 @@ def _handle_coordinator_update(
107108
self._attr_current_option = selected_day
108109
self.async_write_ha_state()
109110

110-
111111
async def async_select_option(self, option: str) -> None:
112112
"""Handle selection of a new day."""
113113
self._attr_current_option = option
@@ -138,4 +138,4 @@ async def async_update(self) -> None:
138138
selected_day = day
139139
break
140140

141-
self._attr_current_option = selected_day
141+
self._attr_current_option = selected_day

0 commit comments

Comments
 (0)