diff --git a/NWS_Weather/observation.py b/NWS_Weather/observation.py index 9a16199..66ad5d4 100644 --- a/NWS_Weather/observation.py +++ b/NWS_Weather/observation.py @@ -7,7 +7,15 @@ def __init__(self, data): self.data = data def __str__(self): - return ", ".join(self.data) + if type(self.data) != dict: + return "No Present Weather" + + str = "Present Weather:" + + for key in self.data.keys(): + str += f"{key}: {self.data[key]['value']}" + + return str class CloudLayers: layers: list @@ -102,8 +110,8 @@ def __init__(self, data: dict): self.cloud_layers = CloudLayers(data['properties']['cloudLayers']) def __str__(self): - return f"""{self.timestamp} - + return f"""{self.timestamp.strftime("%m/%d/%Y, %H:%M:%S")} + {self.raw_message} {self.text_description} {self.icon}