Skip to content

Commit 3a5ae85

Browse files
authored
Merge pull request #16 from brentru/expose-ip-addr
Expose the IP Address from WiFiManager
2 parents 109eba6 + 6ce69bd commit 3a5ae85

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

adafruit_esp32spi/adafruit_esp32spi_wifimanager.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,16 @@ def ping(self, host, ttl=250):
202202
self.pixel_status(0)
203203
return response_time
204204

205+
def ip_address(self):
206+
"""
207+
Returns a formatted local IP address, update status pixel.
208+
"""
209+
if not self._esp.is_connected:
210+
self.connect()
211+
self.pixel_status((0, 0, 100))
212+
self.pixel_status(0)
213+
return self._esp.pretty_ip(self._esp.ip_address)
214+
205215
def pixel_status(self, value):
206216
"""
207217
Change Status NeoPixel if it was defined

0 commit comments

Comments
 (0)