+ )
+ ), shell=True)
+
+
+ def handle_timer(self):
+ self.refresh_devices()
+
+
+ def refresh_devices(self):
+ devices = get_network_devices()
+ #add not registered devices
+ for k,v in devices.items():
+ if k not in self.devices:
+ self.devices[k] = Device(k,v)
+ #delete dead devices
+ for k in self.devices.keys():
+ if k not in devices:
+ del self.devices[k]
+