diff --git a/libs/monitor/xaal/monitor/monitor.py b/libs/monitor/xaal/monitor/monitor.py index 9294b4ffef608a617c7b7bba137f8b978eeff56a..d50ce8bc7c3d040810be34f75f30b6ab21de0874 100644 --- a/libs/monitor/xaal/monitor/monitor.py +++ b/libs/monitor/xaal/monitor/monitor.py @@ -26,20 +26,21 @@ class TimedDict(dict): dict.__init__(self, data) self.last_update = 0 self.next_update = 0 + self.refresh_rate = refresh_rate def updated(self): self.last_update = now() - self.next_update = self.last_update + REFRESH_RATE + random.randint(-30, 30) + self.next_update = self.last_update + self.refresh_rate + random.randint(-30, 30) def __setitem__(self, key, item): super().__setitem__(key, item) self.updated() - def update(self, dict_): + def update(self, args, **kwargs): changed = False if self.last_update != 0 else True - if dict_ != self: + if args != self: changed = True - super().update(dict_) + super().update(args) self.updated() return changed