diff --git a/custom_components/petkit/sensor.py b/custom_components/petkit/sensor.py index 17b014a..6f9818a 100644 --- a/custom_components/petkit/sensor.py +++ b/custom_components/petkit/sensor.py @@ -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: [