Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Update windspots.py #30

wants to merge 3 commits into from

Conversation

Skyrider31
Copy link
Contributor

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}

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}
@Skyrider31 Skyrider31 requested a review from ysavary as a code owner March 15, 2022 10:09
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:]
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

@ysavary
Copy link
Member

ysavary commented Mar 15, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants