Small improvements

This commit is contained in:
Filip Znachor 2022-12-19 13:21:03 +01:00
parent 570f3313da
commit e63cb74648
2 changed files with 4 additions and 3 deletions

View file

@ -83,8 +83,9 @@ class LoraDevice:
}
print(f"{self.id:0>16x} > {message}")
requests.post(url, verify=False, headers=headers, data=json.dumps(payload))
sleep(.5)
self.port += 1
if self.port == 4:
if self.port > 3:
self.port = 1
sleep(5)

View file

@ -21,13 +21,13 @@ class Main:
sys.exit(-1)
self.ended = False
lora_controller = LoraController(self)
self.controller = lora_controller
self.api = API(self)
lora_controller.generate_token()
for d in self.config["devices"]:
lora_controller.new(d["id"], str(d["stop_id"]))
self.controller = lora_controller
self.thread = threading.Thread(target=self.update_loop)
self.thread.start()
self.api = API(self)
def fetch(self, stop_id: str, limit: int):