Skip to content

Commit

Permalink
🐛 fix for DrinkTimes sensors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jezza34000 committed Dec 22, 2024
1 parent 3a1ca64 commit 3fba83d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/petkit/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,11 @@ class PetKitSensorDesc(PetKitDescSensorBase, SensorEntityDescription):
translation_key="drink_times",
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.MEASUREMENT,
value=lambda device: (len(device.device_records)),
value=lambda device: (
len(device.device_records)
if isinstance(device.device_records, list)
else None
),
),
],
Pet: [
Expand Down

0 comments on commit 3fba83d

Please sign in to comment.