File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ def setup(pmCb=False, drawCb=False):
115
115
116
116
if loopEnabled :
117
117
try :
118
- loopCallbacks [srv .loop ] = 0
118
+ loopCallbacks [srv .loop ] = wifiInLoop
119
119
except :
120
120
print ("[SERVICES] Loop requested but not defined in service " + app )
121
121
@@ -152,6 +152,14 @@ def loop_timer_callback(tmr):
152
152
requestedInterval = 99999999
153
153
newLoopCallbacks = loopCallbacks
154
154
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!" )
155
163
rqi = 0
156
164
try :
157
165
rqi = cb ()
@@ -171,6 +179,8 @@ def loop_timer_callback(tmr):
171
179
if requestedInterval >= 99999999 :
172
180
print ("[SERVICES] No loop interval returned." )
173
181
requestedInterval = - 1
182
+
183
+ easywifi .disable () # Always disable wifi
174
184
175
185
try :
176
186
if pmCallback (requestedInterval ):
You can’t perform that action at this time.
0 commit comments