mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Don't update systemmonitor static boot time timestamp (#45165)
This commit is contained in:
parent
1f66457a34
commit
25adc6dd4f
@ -316,9 +316,11 @@ class SystemMonitorSensor(Entity):
|
||||
else:
|
||||
self._state = None
|
||||
elif self.type == "last_boot":
|
||||
self._state = dt_util.as_local(
|
||||
dt_util.utc_from_timestamp(psutil.boot_time())
|
||||
).isoformat()
|
||||
# Only update on initial setup
|
||||
if self._state is None:
|
||||
self._state = dt_util.as_local(
|
||||
dt_util.utc_from_timestamp(psutil.boot_time())
|
||||
).isoformat()
|
||||
elif self.type == "load_1m":
|
||||
self._state = round(os.getloadavg()[0], 2)
|
||||
elif self.type == "load_5m":
|
||||
|
Loading…
x
Reference in New Issue
Block a user