24 lines
No EOL
582 B
Python
24 lines
No EOL
582 B
Python
"""
|
|
Example of getting a darkskies forecast
|
|
from Adafruit IO.
|
|
"""
|
|
# import Adafruit IO REST client.
|
|
from Adafruit_IO import Client, Feed, RequestError
|
|
|
|
# Set to your Adafruit IO key.
|
|
# Remember, your key is a secret,
|
|
# so make sure not to publish it when you publish this code!
|
|
ADAFRUIT_IO_KEY = 'PASS'
|
|
|
|
# Set to your Adafruit IO username.
|
|
# (go to https://accounts.adafruit.com to find your username)
|
|
ADAFRUIT_IO_USERNAME = 'USER'
|
|
|
|
# Create an instance of the REST client.
|
|
aio = Client(ADAFRUIT_IO_USERNAME, ADAFRUIT_IO_KEY)
|
|
|
|
|
|
|
|
forecast = aio.receive_weather(2153)
|
|
|
|
print(forecast) |