adafruit / Adafruit_CircuitPython_PortalBase

Base Library for the Portal-style libraries.
MIT License
18 stars 17 forks source link

Dont require secrets if no network #70

Closed FoamyGuy closed 2 years ago

FoamyGuy commented 2 years ago

This change goes along with: https://github.com/adafruit/Adafruit_CircuitPython_ESP32S2TFT/pull/6 which allows the user to specify with keyword argument that they don't intend to use the network when they initialize the helper class.

The changes here are checking self.network for None and raising exceptions any time the user is attempting to use network related features when they previously specified that they weren't going to use the network and thus self.network got set to None.

FoamyGuy commented 2 years ago

I tested these changes successfully under the following scenarios:

Feather S2 TFT - use_network=False and don't call any functions that are network related features -> prints the warning message but does allow the code to complete

Feather S2 TFT use_network=False and user code does try to use a network related feature -> raises RuntimeError indicating that network must not be None in order to use that feature.

PyPortal Titano - ISS tracking project with normal network configuration -> No change in behavior, works the same as current version of PortalBase.