File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 7
7
to show and update the current time with a FlipClock on a display.
8
8
"""
9
9
10
+ from os import getenv
10
11
import time
11
12
import board
12
13
import socketpool
16
17
import adafruit_ntp
17
18
from adafruit_displayio_flipclock .flip_clock import FlipClock
18
19
19
- # Get wifi details and more from a secrets.py file
20
- try :
21
- from secrets import secrets
22
- except ImportError :
23
- print ("WiFi secrets are kept in secrets.py, please add them there!" )
24
- raise
20
+ # Get WiFi details, ensure these are setup in settings.toml
21
+ ssid = getenv ("CIRCUITPY_WIFI_SSID" )
22
+ password = getenv ("CIRCUITPY_WIFI_PASSWORD" )
25
23
26
24
ANIMATION_DELAY = 0.01
27
25
TRANSPARENT_INDEXES = range (11 )
30
28
MEDIUM_LEVEL = 0.9
31
29
UTC_OFFSET = - 5
32
30
33
- wifi .radio .connect (secrets [ " ssid" ], secrets [ " password" ] )
31
+ wifi .radio .connect (ssid , password )
34
32
pool = socketpool .SocketPool (wifi .radio )
35
33
ntp = adafruit_ntp .NTP (pool , tz_offset = UTC_OFFSET )
36
34
You can’t perform that action at this time.
0 commit comments