Skip to content

Ikea Vindriktning auth / exception #2634

Closed
@mikeysklar

Description

@mikeysklar

Two suggested changes to make the Ikea Vindriktning example script working out of the box.

  1. 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")
  1. 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:

https://forums.adafruit.com/viewtopic.php?t=204719

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions