Skip to content

Commit daa2574

Browse files
committed
Allow wifi settings for service to work.
1 parent 2490f79 commit daa2574

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

esp32/modules/services.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def setup(pmCb=False, drawCb=False):
115115

116116
if loopEnabled:
117117
try:
118-
loopCallbacks[srv.loop] = 0
118+
loopCallbacks[srv.loop] = wifiInLoop
119119
except:
120120
print("[SERVICES] Loop requested but not defined in service "+app)
121121

@@ -152,6 +152,14 @@ def loop_timer_callback(tmr):
152152
requestedInterval = 99999999
153153
newLoopCallbacks = loopCallbacks
154154
for cb in loopCallbacks:
155+
if loopCallbacks[cb]:
156+
print("[SERVICES] Loop needs wifi!")
157+
if not easywifi.status():
158+
if not easywifi.enable():
159+
print("[SERVICES] Wifi not available!")
160+
continue
161+
else:
162+
print("[SERVICES] Loop does not need wifi!")
155163
rqi = 0
156164
try:
157165
rqi = cb()
@@ -171,6 +179,8 @@ def loop_timer_callback(tmr):
171179
if requestedInterval>=99999999:
172180
print("[SERVICES] No loop interval returned.")
173181
requestedInterval = -1
182+
183+
easywifi.disable() # Always disable wifi
174184

175185
try:
176186
if pmCallback(requestedInterval):

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy