Skip to content

Commit e0ab926

Browse files
brentrubrentru
brentru
authored and
brentru
committed
update examples for adafruit io circuitpython guides to use new IO_HTTP class
1 parent 75bf783 commit e0ab926

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

PyPortal_AdafruitIO_Logger/pyportal_adafruit_io_logger.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
# Import NeoPixel Library
2121
import neopixel
2222

23-
# Import Adafruit IO REST Client
24-
from adafruit_io.adafruit_io import RESTClient, AdafruitIO_RequestError
23+
# Import Adafruit IO HTTP Client
24+
from adafruit_io.adafruit_io import IO_HTTP, AdafruitIO_RequestError
2525

2626
# Import ADT7410 Library
2727
import adafruit_adt7410
@@ -51,8 +51,8 @@
5151
ADAFRUIT_IO_USER = secrets['aio_username']
5252
ADAFRUIT_IO_KEY = secrets['aio_key']
5353

54-
# Create an instance of the Adafruit IO REST client
55-
io = RESTClient(ADAFRUIT_IO_USER, ADAFRUIT_IO_KEY, wifi)
54+
# Create an instance of the Adafruit IO HTTP client
55+
io = IO_HTTP(ADAFRUIT_IO_USER, ADAFRUIT_IO_KEY, wifi)
5656

5757
try:
5858
# Get the 'temperature' feed from Adafruit IO

PyPortal_IOT_Scale/pyportal_scale.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
from adafruit_esp32spi import adafruit_esp32spi, adafruit_esp32spi_wifimanager
1818
import neopixel
19-
from adafruit_io.adafruit_io import RESTClient
19+
from adafruit_io.adafruit_io import IO_HTTP
2020

2121
# Get wifi details and more from a secrets.py file
2222
try:
@@ -74,8 +74,8 @@
7474
aio_username = secrets['aio_username']
7575
aio_key = secrets['aio_key']
7676

77-
# Create an instance of the Adafruit IO REST client
78-
io = RESTClient(aio_username, aio_key, wifi)
77+
# Create an instance of the IO_HTTP client
78+
io = IO_HTTP(aio_username, aio_key, wifi)
7979

8080
# Get the weight feed from IO
8181
weight_feed = io.get_feed('weight')

PyPortal_Smart_Thermometer/thermometer.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import adafruit_adt7410
1616

1717
from adafruit_esp32spi import adafruit_esp32spi, adafruit_esp32spi_wifimanager
18-
from adafruit_io.adafruit_io import RESTClient, AdafruitIO_RequestError
18+
from adafruit_io.adafruit_io import IO_HTTP, AdafruitIO_RequestError
1919

2020
# thermometer graphics helper
2121
import thermometer_helper
@@ -49,8 +49,8 @@
4949
raise KeyError('To use this code, you need to include your Adafruit IO username \
5050
and password in a secrets.py file on the CIRCUITPY drive.')
5151

52-
# Create an instance of the Adafruit IO REST client
53-
io = RESTClient(ADAFRUIT_IO_USER, ADAFRUIT_IO_KEY, wifi)
52+
# Create an instance of the IO_HTTP client
53+
io = IO_HTTP(ADAFRUIT_IO_USER, ADAFRUIT_IO_KEY, wifi)
5454

5555
# Get the temperature feed from Adafruit IO
5656
temperature_feed = io.get_feed('temperature')

pyportal_weather_station/code.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from digitalio import DigitalInOut
1616

1717
from adafruit_esp32spi import adafruit_esp32spi, adafruit_esp32spi_wifimanager
18-
from adafruit_io.adafruit_io import RESTClient, AdafruitIO_RequestError
18+
from adafruit_io.adafruit_io import IO_HTTP, AdafruitIO_RequestError
1919

2020
# sensor libs
2121
import adafruit_veml6075
@@ -56,8 +56,8 @@
5656
ADAFRUIT_IO_USER = secrets['aio_username']
5757
ADAFRUIT_IO_KEY = secrets['aio_key']
5858

59-
# Create an instance of the Adafruit IO REST client
60-
io = RESTClient(ADAFRUIT_IO_USER, ADAFRUIT_IO_KEY, wifi)
59+
# Create an instance of the Adafruit IO HTTP client
60+
io = IO_HTTP(ADAFRUIT_IO_USER, ADAFRUIT_IO_KEY, wifi)
6161

6262
# create an i2c object
6363
i2c = busio.I2C(board.SCL, board.SDA)

0 commit comments

Comments
 (0)