Skip to content

Commit 2490f79

Browse files
committed
Revert "Allow wifi settings for service to work."
This reverts commit ede709b.
1 parent ede709b commit 2490f79

File tree

2 files changed

+7
-20
lines changed

2 files changed

+7
-20
lines changed

esp32/modules/easyrtc.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,8 @@
77
import machine, time
88

99
# Functions
10-
def string(print_date=False, print_time=True, timestamp = -1):
11-
if timestamp<0:
12-
[year, month, mday, wday, hour, minute, sec, usec] = machine.RTC().datetime()
13-
else:
14-
[year, month, mday, hour, minute, second, wday, yday] = time.localtime(timestamp)
10+
def string(date=False, time=True):
11+
[year, month, mday, wday, hour, min, sec, usec] = machine.RTC().datetime()
1512
monthstr = str(month)
1613
if (month<10):
1714
monthstr = "0"+monthstr
@@ -21,15 +18,15 @@ def string(print_date=False, print_time=True, timestamp = -1):
2118
hourstr = str(hour)
2219
if (hour<10):
2320
hourstr = "0"+hourstr
24-
minstr = str(minute)
25-
if (minute<10):
21+
minstr = str(min)
22+
if (min<10):
2623
minstr = "0"+minstr
2724
output = ""
28-
if print_date:
25+
if date:
2926
output += daystr+"-"+monthstr+"-"+str(year)
3027
if time:
3128
output += " "
32-
if print_time:
29+
if time:
3330
output += hourstr+":"+minstr
3431
return output
3532

esp32/modules/services.py

Lines changed: 1 addition & 11 deletions
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] = wifiInLoop
118+
loopCallbacks[srv.loop] = 0
119119
except:
120120
print("[SERVICES] Loop requested but not defined in service "+app)
121121

@@ -152,14 +152,6 @@ 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!")
163155
rqi = 0
164156
try:
165157
rqi = cb()
@@ -179,8 +171,6 @@ def loop_timer_callback(tmr):
179171
if requestedInterval>=99999999:
180172
print("[SERVICES] No loop interval returned.")
181173
requestedInterval = -1
182-
183-
easywifi.disable() # Always disable wifi
184174

185175
try:
186176
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