mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-24 09:48:53 +02:00
Temp disabled uptime sensor
This commit is contained in:
parent
71a4b7c812
commit
136daa7c08
1 changed files with 9 additions and 9 deletions
|
@ -718,15 +718,15 @@ class MikrotikControllerData:
|
|||
],
|
||||
)
|
||||
|
||||
l = list(map(int, re.split('[whms]', self.data["resource"]["uptime_str"])[:-1]))
|
||||
if len(l) == 4:
|
||||
self.data["resource"]["uptime"] = l[0] * 604800 + l[1] * 3600 + l[2] * 60 + l[3]
|
||||
elif len(l) == 3:
|
||||
self.data["resource"]["uptime"] = l[0] * 3600 + l[1] * 60 + l[2]
|
||||
elif len(l) == 2:
|
||||
self.data["resource"]["uptime"] = l[0] * 60 + l[1]
|
||||
else:
|
||||
self.data["resource"]["uptime"] = l[0]
|
||||
# l = list(map(int, re.split('[wdhms]', self.data["resource"]["uptime_str"])[:-1]))
|
||||
# if len(l) == 4:
|
||||
# self.data["resource"]["uptime"] = l[0] * 604800 + l[1] * 3600 + l[2] * 60 + l[3]
|
||||
# elif len(l) == 3:
|
||||
# self.data["resource"]["uptime"] = l[0] * 3600 + l[1] * 60 + l[2]
|
||||
# elif len(l) == 2:
|
||||
# self.data["resource"]["uptime"] = l[0] * 60 + l[1]
|
||||
# else:
|
||||
# self.data["resource"]["uptime"] = l[0]
|
||||
|
||||
if self.data["resource"]["total-memory"] > 0:
|
||||
self.data["resource"]["memory-usage"] = round(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue