Board now support messages

This commit is contained in:
Profitroll 2022-10-06 13:17:16 +02:00
parent a5022011ed
commit 7e0d381523

View File

@ -1,14 +1,16 @@
from datetime import datetime from datetime import datetime
from pyrmv.methods.journey_detail import journey_detail from pyrmv.methods.journey_detail import journey_detail
from pyrmv.methods.stop_by_id import stop_by_id from pyrmv.methods.stop_by_id import stop_by_id
from pyrmv.classes.Message import Message
class LineArrival(): class LineArrival():
def __init__(self, data, access_id: str): def __init__(self, data, access_id: str):
self.journey = journey_detail(access_id, data["JourneyDetailRef"]["ref"]) self.journey = journey_detail(access_id, data["JourneyDetailRef"]["ref"])
self.status = data["JourneyStatus"] self.status = data["JourneyStatus"]
# self.messages = [] self.messages = []
for message in data["Messages"]["Message"]:
self.messages.append(Message(message))
self.name = data["name"] self.name = data["name"]
self.type = data["type"] self.type = data["type"]
self.stop_name = data["stop"] self.stop_name = data["stop"]
@ -31,7 +33,9 @@ class LineDeparture():
def __init__(self, data, access_id: str): def __init__(self, data, access_id: str):
self.journey = journey_detail(access_id, data["JourneyDetailRef"]["ref"]) self.journey = journey_detail(access_id, data["JourneyDetailRef"]["ref"])
self.status = data["JourneyStatus"] self.status = data["JourneyStatus"]
# self.messages = [] self.messages = []
for message in data["Messages"]["Message"]:
self.messages.append(Message(message))
self.name = data["name"] self.name = data["name"]
self.type = data["type"] self.type = data["type"]
self.stop_name = data["stop"] self.stop_name = data["stop"]