Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions custom_components/minibrew/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@ class KegSensor(SensorEntity):
def __init__(self, coordinator, device: Device, state: str):
"""Initialize the sensor."""
self.coordinator = coordinator
self.device = device
self.device_id = device.serial_number
self.device_type = state
self._attr_device_info = {
Expand All @@ -472,7 +473,7 @@ def __init__(self, coordinator, device: Device, state: str):
@property
def unique_id(self):
"""Return a unique ID for the sensor."""
return f"{self.device.serial_number}_{self.name}"
return f"{self.device_id}_{self.name}"

@property
def available(self):
Expand Down Expand Up @@ -652,7 +653,7 @@ def icon(self):
@property
def unique_id(self):
"""Return the unique ID of the sensor."""
return f"{self.device_id.serial_number}_{self.name}"
return f"{self.device_id}_{self.name}"


class KegIsUpdatingSensor(KegSensor):
Expand Down