-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update windspots.py #30
base: main
Are you sure you want to change the base?
Conversation
New API from Windspots.com URL explore API : https://api.windspots.org/explorer/#/mobile Don't know when the URL https://api.windspots.com/windmobile/stationinfo will be decommissioned. proactively changed the mapping Need to be tested specially the mapping on the stations details -> https//api.windspots.org/mobile/stationdata?station={windspots_id}
timeout=(self.connect_timeout, self.read_timeout), | ||
verify=False, | ||
) | ||
|
||
for windspots_station in result.json()["stationInfo"]: | ||
station_id = None | ||
try: | ||
windspots_id = windspots_station["winId"][10:] | ||
windspots_id = windspots_station["stationName"][10:] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the 1st 10 chars is returning an invalid id
@@ -51,13 +51,13 @@ def process_data(self): | |||
raise ProviderException("Action=Data return invalid json response") | |||
|
|||
try: | |||
key = arrow.get(windspots_measure["@lastUpdate"], "YYYY-M-DTHH:mm:ssZ").int_timestamp | |||
key = arrow.get(windspots_measure["lastUpdate"], "YYYY-M-DTHH:mm:ssZ").int_timestamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lastUpdate
is not existing any more with this new API
@@ -51,13 +51,13 @@ def process_data(self): | |||
raise ProviderException("Action=Data return invalid json response") | |||
|
|||
try: | |||
key = arrow.get(windspots_measure["@lastUpdate"], "YYYY-M-DTHH:mm:ssZ").int_timestamp | |||
key = arrow.get(windspots_measure["lastUpdate"], "YYYY-M-DTHH:mm:ssZ").int_timestamp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lastUpdate
is not existing any more with this new API
The linter failed. Please format your code with black: https://github.com/winds-mobi/winds-mobi-providers/blob/main/README.md#checking-the-code-style |
New API from Windspots.com
URL explore API : https://api.windspots.org/explorer/#/mobile
Don't know when the URL https://api.windspots.com/windmobile/stationinfo will be decommissioned.
proactively changed the mapping
Need to be tested specially the mapping on the stations details -> https//api.windspots.org/mobile/stationdata?station={windspots_id}