Skip to content
This repository was archived by the owner on Mar 19, 2024. It is now read-only.

Commit 25f5923

Browse files
Multi-device report sensors (#174)
Unique id for reports to manage the same sensors on several devices
1 parent 11bec7a commit 25f5923

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

custom_components/multimatic/sensor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class ReportSensor(MultimaticEntity, SensorEntity):
107107

108108
def __init__(self, coordinator: MultimaticCoordinator, report: Report) -> None:
109109
"""Init entity."""
110-
MultimaticEntity.__init__(self, coordinator, DOMAIN, report.id)
110+
MultimaticEntity.__init__(self, coordinator, DOMAIN, f"{report.device_id}_{report.id}")
111111
self._report_id = report.id
112112
self._unit = report.unit
113113
self._name = report.name
@@ -122,7 +122,7 @@ def report(self):
122122
(
123123
report
124124
for report in self.coordinator.data
125-
if report.id == self._report_id
125+
if report.device_id == self._device_id and report.id == self._report_id
126126
),
127127
None,
128128
)

0 commit comments

Comments
 (0)