adds uptime section for controller

This commit is contained in:
Robert Sander 2024-02-16 10:06:56 +01:00
parent f96bd89f55
commit 8718bf4183
3 changed files with 5 additions and 1 deletions

View File

@ -492,7 +492,7 @@ class unifi_controller(unifi_object):
def __str__(self):
_ret = ["<<<unifi_controller:sep(124)>>>"]
for _k,_v in self.__dict__.items():
if _k.startswith("_") or type(_v) not in (str,int,float):
if _k == "uptime" or _k.startswith("_") or type(_v) not in (str,int,float):
continue
_ret.append(f"{_k}|{_v}")
@ -503,6 +503,10 @@ class unifi_controller(unifi_object):
_udm._piggy_back = False
_ret.append(str(_udm))
if "uptime" in self.__dict__:
_ret.append("<<<uptime>>>")
_ret.append(f"{self.uptime}")
_ret.append("<<<labels:sep(0)>>>")
_ret.append(f"{{\"unifi_device\":\"unifi-{self.type}\"}}")

Binary file not shown.

BIN
unifi_controller-0.88.2.mkp Normal file

Binary file not shown.