Reduce jumping Starlink uptime sensor (#143076)

This commit is contained in:
Franck Nijhof 2025-04-16 12:23:54 +02:00
parent 80ef32f09d
commit 2f99164781
No known key found for this signature in database
GPG Key ID: AB33ADACE7101952

View File

@ -113,7 +113,9 @@ SENSORS: tuple[StarlinkSensorEntityDescription, ...] = (
translation_key="last_boot_time", translation_key="last_boot_time",
device_class=SensorDeviceClass.TIMESTAMP, device_class=SensorDeviceClass.TIMESTAMP,
entity_category=EntityCategory.DIAGNOSTIC, entity_category=EntityCategory.DIAGNOSTIC,
value_fn=lambda data: now() - timedelta(seconds=data.status["uptime"]), value_fn=lambda data: (
now() - timedelta(seconds=data.status["uptime"])
).replace(microsecond=0),
), ),
StarlinkSensorEntityDescription( StarlinkSensorEntityDescription(
key="ping_drop_rate", key="ping_drop_rate",