Skip to content

Commit

Permalink
change 'extra_attributes' type to tuple
Browse files Browse the repository at this point in the history
  • Loading branch information
ggajoch committed Jan 4, 2024
1 parent ab3888a commit da92c67
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 15 deletions.
4 changes: 1 addition & 3 deletions custom_components/luxtronik/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,7 @@ class LuxtronikEntityDescription(EntityDescription):
invisible_if_value: Any | None = None
min_firmware_version_minor: FirmwareVersionMinor | None = None

extra_attributes: list[LuxtronikEntityAttributeDescription] = field(
default_factory=list
)
extra_attributes: tuple(LuxtronikEntityAttributeDescription) = ()
state_class: str | None = None


Expand Down
4 changes: 2 additions & 2 deletions custom_components/luxtronik/number_entities_predefined.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,14 +408,14 @@
entity_category=EntityCategory.CONFIG,
mode=NumberMode.BOX,
factor=0.1,
extra_attributes=[
extra_attributes=(
attr(
SA.LAST_THERMAL_DESINFECTION,
LC.C0017_DHW_TEMPERATURE,
SensorAttrFormat.TIMESTAMP_LAST_OVER,
True,
),
],
),
),
# region Solar
LuxtronikNumberDescription(
Expand Down
20 changes: 10 additions & 10 deletions custom_components/luxtronik/sensor_entities_predefined.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
luxtronik_key=LC.C0080_STATUS,
icon_by_state=LUX_STATE_ICON_MAP,
device_class=SensorDeviceClass.ENUM,
extra_attributes=[
extra_attributes=(
attr(SA.EVU_FIRST_START_TIME, LC.UNSET, None, True),
attr(SA.EVU_FIRST_END_TIME, LC.UNSET, None, True),
attr(SA.EVU_SECOND_START_TIME, LC.UNSET, None, True),
attr(SA.EVU_SECOND_END_TIME, LC.UNSET, None, True),
],
),
options=[e.value for e in LuxOperationMode],
update_interval=UPDATE_INTERVAL_NORMAL,
),
Expand Down Expand Up @@ -79,7 +79,7 @@
native_unit_of_measurement=UnitOfTime.SECONDS,
entity_registry_visible_default=False,
native_precision=0,
extra_attributes=[
extra_attributes=(
attr(SA.STATUS_TEXT, LC.C0120_STATUS_TIME, SensorAttrFormat.HOUR_MINUTE),
attr(SA.TIMER_HEATPUMP_ON, LC.C0067_TIMER_HEATPUMP_ON),
attr(SA.TIMER_ADD_HEAT_GENERATOR_ON, LC.C0068_TIMER_ADD_HEAT_GENERATOR_ON),
Expand All @@ -94,7 +94,7 @@
attr(SA.TIMER_BLOCK_DHW, LC.C0077_TIMER_BLOCK_DHW),
attr(SA.TIMER_DEFROST, LC.C0141_TIMER_DEFROST),
attr(SA.TIMER_HOT_GAS, LC.C0158_TIMER_HOT_GAS),
],
),
),
descr(
key=SensorKey.STATUS_LINE_1,
Expand Down Expand Up @@ -436,12 +436,12 @@
key=SensorKey.ERROR_REASON,
luxtronik_key=LC.C0100_ERROR_REASON,
icon="mdi:alert",
extra_attributes=[
extra_attributes=(
attr(SA.TIMESTAMP, LC.C0095_ERROR_TIME),
attr(SA.CODE, LC.C0100_ERROR_REASON),
attr(SA.CAUSE, LC.C0100_ERROR_REASON),
attr(SA.REMEDY, LC.C0100_ERROR_REASON),
],
),
),
# endregion Main heatpump
# region Heating
Expand All @@ -454,13 +454,13 @@
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
extra_attributes=[
extra_attributes=(
attr(
SA.MAX_ALLOWED,
LP.P0149_FLOW_IN_TEMPERATURE_MAX_ALLOWED,
SensorAttrFormat.CELSIUS_TENTH,
),
],
),
),
descr(
key=SensorKey.FLOW_OUT_TEMPERATURE,
Expand All @@ -481,13 +481,13 @@
state_class=SensorStateClass.MEASUREMENT,
device_class=SensorDeviceClass.TEMPERATURE,
native_unit_of_measurement=UnitOfTemperature.CELSIUS,
extra_attributes=[
extra_attributes=(
attr(
SA.SWITCH_GAP,
LC.C0011_FLOW_OUT_TEMPERATURE,
SensorAttrFormat.SWITCH_GAP,
),
],
),
),
descr(
key=SensorKey.OPERATION_HOURS_HEATING,
Expand Down

0 comments on commit da92c67

Please sign in to comment.