Skip to content

Commit edeb71b

Browse files
committed
fix import in countviewer example, add ValueError to Execption trap in examples
1 parent ee86085 commit edeb71b

6 files changed

+8
-8
lines changed

examples/espatcontrol_aio_post.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
response.close()
6262
counter = counter + 1
6363
print("OK")
64-
except (RuntimeError, adafruit_espatcontrol.OKError) as e:
64+
except (ValueError, RuntimeError, adafruit_espatcontrol.OKError) as e:
6565
print("Failed to get data, retrying\n", e)
6666
continue
6767
response = None

examples/espatcontrol_cheerlights.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
r = requests.get(DATA_SOURCE)
6464
builtin[0] = (0, 0, 100)
6565
print("Reply is OK!")
66-
except (RuntimeError, adafruit_espatcontrol.OKError) as e:
66+
except (ValueError, RuntimeError, adafruit_espatcontrol.OKError) as e:
6767
print("Failed to get data, retrying\n", e)
6868
continue
6969
print('-'*40,)

examples/espatcontrol_countviewer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import board
99
import busio
1010
from digitalio import DigitalInOut
11-
import adafruit_espatcontrol
12-
import adafruit_espatcontrol_requests as requests
11+
from adafruit_espatcontrol import adafruit_espatcontrol
12+
from adafruit_espatcontrol import adafruit_espatcontrol_requests as requests
1313
from adafruit_ht16k33 import segments
1414
import neopixel
1515

@@ -119,7 +119,7 @@ def chime_light():
119119
print("Retrieving data source...", end='')
120120
r = requests.get(DATA_SOURCE)
121121
print("Reply is OK!")
122-
except (RuntimeError, adafruit_espatcontrol.OKError) as e:
122+
except (ValueError, RuntimeError, adafruit_espatcontrol.OKError) as e:
123123
print("Failed to get data, retrying\n", e)
124124
continue
125125
#print('-'*40,)

examples/espatcontrol_quoteEPD.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def draw_bmp(filename, x, y): # pylint: disable=too-many-locals, too-many-branch
177177
print("Retrieving data source...", end='')
178178
req = requests.get(DATA_SOURCE)
179179
print("Reply is OK!")
180-
except (RuntimeError, adafruit_espatcontrol.OKError) as e:
180+
except (ValueError, RuntimeError, adafruit_espatcontrol.OKError) as e:
181181
print("Failed to get data, retrying\n", e)
182182
continue
183183

examples/espatcontrol_simpletest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@
3535
print("Pinging 8.8.8.8...", end="")
3636
print(esp.ping("8.8.8.8"))
3737
time.sleep(10)
38-
except (RuntimeError, adafruit_espatcontrol.OKError) as e:
38+
except (ValueError,RuntimeError, adafruit_espatcontrol.OKError) as e:
3939
print("Failed to get data, retrying\n", e)
4040
continue

examples/espatcontrol_webclient.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@
4141
print("Text:", r.text)
4242

4343
time.sleep(60)
44-
except (RuntimeError, adafruit_espatcontrol.OKError) as e:
44+
except (ValueError, RuntimeError, adafruit_espatcontrol.OKError) as e:
4545
print("Failed to get data, retrying\n", e)
4646
continue

0 commit comments

Comments
 (0)