Skip to content

Commit

Permalink
Add station info to self
Browse files Browse the repository at this point in the history
  • Loading branch information
FL550 committed Oct 31, 2023
1 parent ab584f6 commit 3d2cdbe
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions simple_dwd_weatherforecast/dwdforecast.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ class Weather:
NOT_AVAILABLE = "---"

station_id = ""
station_name = ""
issue_time = None
forecast_data = None
report_data = None
Expand Down Expand Up @@ -196,16 +195,15 @@ class Weather:

def __init__(self, station_id):
self.etags = {}
station = load_station_id(station_id)
if station:
self.station = load_station_id(station_id)
if self.station:
self.station_id = station_id
self.station_name = station["name"]
self.region = get_region(station_id)
else:
raise ValueError("Not a valid station_id")

def get_station_name(self):
return self.station_name
return self.station["name"]

def is_in_timerange(self, timestamp: datetime):
return (
Expand Down

0 comments on commit 3d2cdbe

Please sign in to comment.