Reduce jumping Starlink uptime sensor (#143076)

This commit is contained in:
Franck Nijhof 2025-04-16 12:23:54 +02:00 committed by GitHub
parent e6262de5ab
commit 187024367a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -113,7 +113,9 @@ SENSORS: tuple[StarlinkSensorEntityDescription, ...] = (
translation_key="last_boot_time",
device_class=SensorDeviceClass.TIMESTAMP,
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(
key="ping_drop_rate",