There are a total of four code files that make this project happen:,, and Most similar are the and files. Their function is to hold user data that is then pulled into both and to allow everything to run smoothly.

If you've ever done a PyPortal project or other IoT project with CircuitPython, then the file will be familiar to you. It allows you to store your WiFi network's SSID and password, along with other sensitive information, separately from your main program, so that you don't accidentally share your info when sharing your code.

In the case of this project, you will need your network information, as well as your OpenWeatherMaps token, Adafruit AIO information and your location, all formatted to be able to pass it to OpenWeatherMaps. By keeping your location in, you can easily edit it without diving too deep into the main program or risk breaking anything.

# This file is where you keep secret settings, passwords, and tokens!
# If you put them in the code you risk committing that info or sharing it

secrets = {
    'ssid' : 'your-ssid-here',
    'password' : 'your-password-here',
    'openweather_token' : 'your-openweather-token-here',
    'aio_username' : "your-aio-username-here",
    'aio_key' : 'your-aio-key-here',
    'location' : 'New York, US'

This guide was first published on Jan 29, 2020. It was last updated on Jan 29, 2020.

This page (Code Walkthrough - was last updated on Jun 12, 2021.

Text editor powered by tinymce.