mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +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:
|
else:
|
||||||
self._state = None
|
self._state = None
|
||||||
elif self.type == "last_boot":
|
elif self.type == "last_boot":
|
||||||
self._state = dt_util.as_local(
|
# Only update on initial setup
|
||||||
dt_util.utc_from_timestamp(psutil.boot_time())
|
if self._state is None:
|
||||||
).isoformat()
|
self._state = dt_util.as_local(
|
||||||
|
dt_util.utc_from_timestamp(psutil.boot_time())
|
||||||
|
).isoformat()
|
||||||
elif self.type == "load_1m":
|
elif self.type == "load_1m":
|
||||||
self._state = round(os.getloadavg()[0], 2)
|
self._state = round(os.getloadavg()[0], 2)
|
||||||
elif self.type == "load_5m":
|
elif self.type == "load_5m":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user