Enabled server update sending

This commit is contained in:
Filip Znachor 2022-11-24 23:50:58 +01:00
parent 5cd0fa2906
commit be710a6128
2 changed files with 2 additions and 4 deletions

View file

@ -83,7 +83,7 @@ class Departure:
def update(self, delay):
self.delay = delay
#DeviceController.data(self)
DeviceController.data(self)
def get_departure(self):
departure = -round(((datetime.now().timestamp() - (self.departure + self.delay*60))/60)*10)
@ -91,5 +91,3 @@ class Departure:
def __repr__(self):
return f"{self.id}|{self.line}|{self.last_stop}|{floor(self.get_departure()/10)}"
# {'ConnectionId': {'ConnectionId': -302285, 'InTraffic': True, 'BoardingStopIndex': None, 'GettingOffStopIndex': None}, 'Line': {'Name': '30', 'Number': 445030, 'TractionType': 3, 'IsBarrierFree': True, 'IsNightConnection': False}, 'DepartureTime': '2022-11-14T21:55:00+01:00', 'LastStopName': 'Sídliště Košutka', 'DelayMin': 0, 'LeavingInMin': 0, 'Stops': None, 'QuickMessageIds': []}

View file

@ -9,7 +9,7 @@ LoraDevice.generate_token()
while True:
if refetch == 0:
Departure.fetch("40", 10)
Departure.fetch("40", 40)
refetch = (refetch + 1) % 10
sleep(.1)