Skip to content

Commit

Permalink
Restore device_sn property
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjeschke committed Dec 24, 2024
1 parent 438c764 commit 2aa8d3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ async def refresh(self):
def battery_state(self) -> str | None:
return self._data.get("batteryState")

@property
def device_sn(self) -> str:
"""Returns the serial number of the device."""
return self._data.get("deviceSn", "unknown")

@property
def door_blocked(self) -> bool | None:
return self._data.get("realInfo", {}).get("barnDoorError")
Expand Down
2 changes: 1 addition & 1 deletion custom_components/petlibro/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ def device_class(self) -> SensorDeviceClass | None:
],
PolarWetFoodFeeder: [
PetLibroSensorEntityDescription[PolarWetFoodFeeder](
key="serial",
key="device_sn",
translation_key="device_sn",
icon="mdi:identifier",
name="Device SN"
Expand Down

0 comments on commit 2aa8d3a

Please sign in to comment.