fixed some bugs with scanning being too fast to get data and killing the tasks

This commit is contained in:
UpstreamData
2022-05-18 12:13:20 -06:00
parent 85b282740a
commit 7f7964526c
3 changed files with 15 additions and 7 deletions

View File

@@ -69,12 +69,12 @@ class TableManager(metaclass=Singleton):
if not data or data == {} or not data.get("IP"):
return
if not data.get("Light"):
data["Light"] = False
if not data["IP"] in self.data.keys():
self.data[data["IP"]] = {}
if not data.get("Light") and not self.data[data["IP"]].get("Light"):
data["Light"] = False
for key in data.keys():
self.data[data["IP"]][key] = data[key]