mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 12:47:08 +00:00
Fix uptime sensor for Vodafone Station (#130215)
This commit is contained in:
parent
c89ab7a142
commit
e6d16f06fc
@ -43,12 +43,10 @@ def _calculate_uptime(
|
||||
) -> datetime:
|
||||
"""Calculate device uptime."""
|
||||
|
||||
assert isinstance(last_value, datetime)
|
||||
|
||||
delta_uptime = coordinator.api.convert_uptime(coordinator.data.sensors[key])
|
||||
|
||||
if (
|
||||
not last_value
|
||||
not isinstance(last_value, datetime)
|
||||
or abs((delta_uptime - last_value).total_seconds()) > UPTIME_DEVIATION
|
||||
):
|
||||
return delta_uptime
|
||||
|
Loading…
x
Reference in New Issue
Block a user