mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 06:37:52 +00:00
Don't update systemmonitor static boot time timestamp (#45165)
This commit is contained in:
parent
1f66457a34
commit
25adc6dd4f
@ -316,6 +316,8 @@ class SystemMonitorSensor(Entity):
|
|||||||
else:
|
else:
|
||||||
self._state = None
|
self._state = None
|
||||||
elif self.type == "last_boot":
|
elif self.type == "last_boot":
|
||||||
|
# Only update on initial setup
|
||||||
|
if self._state is None:
|
||||||
self._state = dt_util.as_local(
|
self._state = dt_util.as_local(
|
||||||
dt_util.utc_from_timestamp(psutil.boot_time())
|
dt_util.utc_from_timestamp(psutil.boot_time())
|
||||||
).isoformat()
|
).isoformat()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user