Skip to content

Commit

Permalink
force sensor group start at room mode registers
Browse files Browse the repository at this point in the history
  • Loading branch information
kodebach committed Nov 10, 2023
1 parent ed60584 commit b73e5e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/idm_heatpump/idm_heatpump.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ def __init__(
if len(self.sensor_groups) == 0
else self.sensor_groups[-1].start + self.sensor_groups[-1].count
)
if len(self.sensor_groups) == 0 or sensor.address != last_address:
if (
len(self.sensor_groups) == 0
or sensor.force_group_start
or sensor.address != last_address
):
self.sensor_groups.append(
IdmHeatpump._SensorGroup(
start=sensor.address,
Expand Down
2 changes: 2 additions & 0 deletions custom_components/idm_heatpump/sensor_addresses.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class BaseSensorAddress(ABC, Generic[_T]):
address: int
name: str
supported_features: SensorFeatures = SensorFeatures.NONE
force_group_start: bool = False

@property
@abstractmethod
Expand Down Expand Up @@ -531,6 +532,7 @@ def sensors(self) -> list[IdmSensorAddress]:
enum=RoomMode,
address=ZONE_OFFSETS[self.index] + ROOM_OFFSETS[room] + 5,
name=f"zone_{self.index+1}_room_{room+1}_mode",
force_group_start=True,
),
]
],
Expand Down

0 comments on commit b73e5e4

Please sign in to comment.