Skip to content

Commit

Permalink
Fixed present weather
Browse files Browse the repository at this point in the history
  • Loading branch information
CSutter5 committed Dec 19, 2023
1 parent e572c72 commit 1f6f0e5
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions NWS_Weather/observation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down

0 comments on commit 1f6f0e5

Please sign in to comment.