The PyPortal fetches and sets the microcontroller's current UTC time. This may take up to 15 seconds.

Formatting the Name Label

Add spaces to the left of the TOTP key name in the totp_keys list to pad the left side:

When the timer is five seconds away from refreshing, the progress bar will change from white to red.

Once the time hits zero, the progress bar resets and the key regenerates. 

Customizing the Authentication Friend

Everyone's desk is different and we can do a bit of customization to our PyPortal authentication friend.


In the file, change BACKGROUND = 0x0to a new hexadecimal color value and save the file.

Customizing the Buttons

We can change the button's fill color and text color.

To change the button's fill color: in the file, change BTN_COLOR = 0xFFFFFF to a hexadecimal color value.

To change the button's text color: in the file, change BTN_TEXT_COLOR to a hexadecimal color value.

Formatting the Name Label

The x-location for the name label is zero by default. You may need to modify the totp_keys list to center shorter TOTP key names.

In, add spaces to the left of the the key in totp_keys to center the names, if desired:

Download: file
'totp_keys' : [("  Discord", "JBSWY3DPEHPK3PXP"),
                   ("   Gmail", "JBSWY3DPEHPK3PZP"),
                   ("  GitHub", "JBSWY5DZEHPK3PXP"),
                   ("  Adafruit", "JBSWY6DZEHPK3PXP"),
                   ("  Outlook", "JBSWY7DZEHPK3PXP")]

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

This page (Code Usage) was last updated on Oct 03, 2020.