Ikea Vindriktning auth / exception
mikeysklar opened this issue · comments
Mikey Sklar commented
Two suggested changes to make the Ikea Vindriktning example script working out of the box.
- Change from lowercase to upper when accessing settings.toml values like this:
# aio_username = os.getenv('aio_username')
# aio_key = os.getenv('aio_key')
aio_username = os.getenv("ADAFRUIT_IO_USERNAME")
aio_key = os.getenv("ADAFRUIT_IO_KEY")
- exception AdafruitIO_RequestError needs to be removed or changed
change this:
try:
# get feed
ikea_pm25 = io.get_feed("ikeapm25")
except AdafruitIO_RequestError:
# if no feed exists, create one
ikea_pm25 = io.create_new_feed("ikeapm25")
to this:
try:
# get feed
ikea_pm25 = io.get_feed("ikeapm25")
except:
# if no feed exists, create one
ikea_pm25 = io.create_new_feed("ikeapm25")
forum thread where this was found:
Liz commented
thanks! merged in