Skip to content
Snippets Groups Projects
Commit e8c5d98b authored by KERDREUX Jerome's avatar KERDREUX Jerome
Browse files

Format

Just a test for new rules
parent d8268714
No related branches found
No related tags found
1 merge request!1First try of type hints
...@@ -177,12 +177,12 @@ class Devices: ...@@ -177,12 +177,12 @@ class Devices:
def get_dev_types(self): def get_dev_types(self):
""" return the list of distinct dev_types""" """ return the list of distinct dev_types"""
l = [] ll = []
for dev in self.__devs.values(): for dev in self.__devs.values():
if dev.dev_type not in l: if dev.dev_type not in ll:
l.append(dev.dev_type) ll.append(dev.dev_type)
l.sort() ll.sort()
return l return ll
def __len__(self): def __len__(self):
return len(self.__devs) return len(self.__devs)
...@@ -255,6 +255,8 @@ class Monitor: ...@@ -255,6 +255,8 @@ class Monitor:
self.notify(Notification.new_device,dev) self.notify(Notification.new_device,dev)
dev = self.devices.get_with_addr(msg.source) dev = self.devices.get_with_addr(msg.source)
if not dev:
return
if msg.is_alive(): if msg.is_alive():
dev.alive(msg.body.get('timeout', config.DEF_ALIVE_TIMER)) dev.alive(msg.body.get('timeout', config.DEF_ALIVE_TIMER))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment