Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update legacy set_socket examples #11

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions examples/oauth2_simpletest_esp32spi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@
import board
import busio
from digitalio import DigitalInOut
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
import adafruit_connection_manager
import adafruit_esp32spi.adafruit_esp32spi_socket as pool
from adafruit_esp32spi import adafruit_esp32spi

import adafruit_requests as requests
import adafruit_requests
from adafruit_oauth2 import OAuth2

# Add a secrets.py to your filesystem that has a dictionary called secrets with "ssid" and
Expand Down Expand Up @@ -36,9 +37,9 @@
continue
print("Connected to", str(esp.ssid, "utf-8"), "\tRSSI:", esp.rssi)

# Initialize a requests object
socket.set_interface(esp)
requests.set_socket(socket, esp)
# Initialize a requests session
ssl_context = adafruit_connection_manager.create_fake_ssl_context(pool, esp)
requests = adafruit_requests.Session(pool, ssl_context)

# Set scope(s) of access required by the API you're using
scopes = ["email"]
Expand Down
Loading