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

Dark Sky #5

Open
wizzard419 opened this issue Mar 24, 2019 · 6 comments
Open

Dark Sky #5

wizzard419 opened this issue Mar 24, 2019 · 6 comments

Comments

@wizzard419
Copy link

Hi, sorry if I am going at this the wrong way, I am new to GitHub
Dark Sky was the suggested new API over weather underground.

Should my call look like
myweather = json.load(urllib2.urlopen('https://api.darksky.net/forecast/' + darksky_api + '/forecast/' + location))

Also, I have might controls set up, but want to use a single strip (smaller sized cloud) and wanted to also make use of the white light in my strip. Do you have any tips?

@stubs
Copy link

stubs commented Sep 29, 2019

Hey @wizzard419. You can totally use the dark sky api, but you'd have to re-write the python code parsing out the weather conditions. The json schema from dark sky doesn't match what you'd get from weather underground.

Also with the dark sky api you need to provide both the latitude and longitude of the location you seeking weather data from. So you couldn't use a simple string for your location anymore (like on line 6.
location = ""

@wizzard419
Copy link
Author

Thanks @stubs! By any chance do you have a way to make this work? I sadly do not have the exp but if you have working code I would gladly compensate. We can discuss this on another venue if needed.

@stubs
Copy link

stubs commented Sep 29, 2019

@wizzard419

No compensation needed. I have a fork of @DJAkbar's repo over here. It is set up to use the dark sky api.
https://github.com/stubs/cloudy-a

  • Only tested on python 3.7. (the stock python of Raspbian Buster).
  • Note: the led animations are not exactly the same as the one in this version of the repo. My version only uses 1 led strip, not 2 led strips like this version. My master branch MIGHT slowly incorporate some changes to the led functions. (when I find time to play around with them 😉)

@wizzard419
Copy link
Author

That is awesome, thank you! I hit a wall when starting on this due to the API going away.

One last question, I have mine set up for single strip but using RGBW. Do I just need to update my entries for the pins and add values for the various scenarios, or is more involved?

@stubs
Copy link

stubs commented Sep 29, 2019

I think you'd only need the RGB (not the W). The gpiozero python package doesn't seem to have support for the "W"....but i didn't even remotely do a deep dive into the docs.

From https://gpiozero.readthedocs.io/en/stable/api_output.html#rgbled

image

If white was still needed you could simply set the color param to (1,1,1)

@wizzard419
Copy link
Author

Oh interesting, I will toy around next weekend to see if I can find a way. Either way this is awesome, thank you again for resurrecting the project.

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

No branches or pull requests

2 participants