micrOSDevToolKit 2.8.7__py3-none-any.whl → 2.9.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- micrOS/release_info/micrOS_ReleaseInfo/system_analysis_sum.json +22 -22
- micrOS/source/Common.py +10 -15
- micrOS/source/Config.py +20 -1
- micrOS/source/LM_buzzer.py +15 -7
- micrOS/source/LM_genIO.py +1 -1
- micrOS/source/LM_neoeffects.py +22 -7
- micrOS/source/LM_neopixel.py +1 -1
- micrOS/source/LM_ph_sensor.py +2 -2
- micrOS/source/LM_presence.py +1 -1
- micrOS/source/LM_system.py +14 -3
- micrOS/source/LM_telegram.py +226 -15
- micrOS/source/Logger.py +6 -0
- micrOS/source/Notify.py +46 -217
- micrOS/source/Shell.py +4 -3
- micrOS/source/Types.py +6 -2
- micrOS/source/Web.py +16 -3
- micrOS/source/micrOSloader.py +16 -13
- {micrOSDevToolKit-2.8.7.dist-info → micrOSDevToolKit-2.9.1.dist-info}/METADATA +20 -7
- {micrOSDevToolKit-2.8.7.dist-info → micrOSDevToolKit-2.9.1.dist-info}/RECORD +42 -42
- toolkit/DevEnvUSB.py +2 -1
- toolkit/MicrOSDevEnv.py +8 -5
- toolkit/workspace/precompiled/Common.mpy +0 -0
- toolkit/workspace/precompiled/Config.mpy +0 -0
- toolkit/workspace/precompiled/LM_buzzer.mpy +0 -0
- toolkit/workspace/precompiled/LM_genIO.mpy +0 -0
- toolkit/workspace/precompiled/LM_neoeffects.mpy +0 -0
- toolkit/workspace/precompiled/LM_neopixel.mpy +0 -0
- toolkit/workspace/precompiled/LM_ph_sensor.py +2 -2
- toolkit/workspace/precompiled/LM_presence.mpy +0 -0
- toolkit/workspace/precompiled/LM_system.mpy +0 -0
- toolkit/workspace/precompiled/LM_telegram.mpy +0 -0
- toolkit/workspace/precompiled/Logger.mpy +0 -0
- toolkit/workspace/precompiled/Notify.mpy +0 -0
- toolkit/workspace/precompiled/Shell.mpy +0 -0
- toolkit/workspace/precompiled/Types.mpy +0 -0
- toolkit/workspace/precompiled/Web.mpy +0 -0
- toolkit/workspace/precompiled/micrOSloader.mpy +0 -0
- toolkit/workspace/precompiled/node_config.json +1 -1
- {micrOSDevToolKit-2.8.7.data → micrOSDevToolKit-2.9.1.data}/scripts/devToolKit.py +0 -0
- {micrOSDevToolKit-2.8.7.dist-info → micrOSDevToolKit-2.9.1.dist-info}/LICENSE +0 -0
- {micrOSDevToolKit-2.8.7.dist-info → micrOSDevToolKit-2.9.1.dist-info}/WHEEL +0 -0
- {micrOSDevToolKit-2.8.7.dist-info → micrOSDevToolKit-2.9.1.dist-info}/top_level.txt +0 -0
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
7
|
|
6
6
|
],
|
|
7
7
|
"micrOSloader.py": [
|
|
8
|
-
|
|
8
|
+
8.0,
|
|
9
9
|
1
|
|
10
10
|
],
|
|
11
11
|
"Hooks.py": [
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
3
|
|
18
18
|
],
|
|
19
19
|
"Web.py": [
|
|
20
|
-
9.
|
|
20
|
+
9.25,
|
|
21
21
|
1
|
|
22
22
|
],
|
|
23
23
|
"Tasks.py": [
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
12
|
|
26
26
|
],
|
|
27
27
|
"Config.py": [
|
|
28
|
-
9.
|
|
29
|
-
|
|
28
|
+
9.49,
|
|
29
|
+
17
|
|
30
30
|
],
|
|
31
31
|
"reset.py": [
|
|
32
32
|
8.75,
|
|
@@ -37,20 +37,20 @@
|
|
|
37
37
|
1
|
|
38
38
|
],
|
|
39
39
|
"Notify.py": [
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
8.38,
|
|
41
|
+
3
|
|
42
42
|
],
|
|
43
43
|
"Types.py": [
|
|
44
|
-
8.
|
|
45
|
-
|
|
44
|
+
8.91,
|
|
45
|
+
29
|
|
46
46
|
],
|
|
47
47
|
"Logger.py": [
|
|
48
|
-
8.
|
|
48
|
+
8.78,
|
|
49
49
|
4
|
|
50
50
|
],
|
|
51
51
|
"Common.py": [
|
|
52
|
-
8.
|
|
53
|
-
|
|
52
|
+
8.71,
|
|
53
|
+
34
|
|
54
54
|
],
|
|
55
55
|
"InterConnect.py": [
|
|
56
56
|
9.4,
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
],
|
|
63
63
|
"Network.py": [
|
|
64
64
|
9.71,
|
|
65
|
-
|
|
65
|
+
8
|
|
66
66
|
],
|
|
67
67
|
"Espnow.py": [
|
|
68
68
|
9.01,
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
0
|
|
110
110
|
],
|
|
111
111
|
"LM_system.py": [
|
|
112
|
-
8.
|
|
113
|
-
|
|
112
|
+
8.36,
|
|
113
|
+
5
|
|
114
114
|
],
|
|
115
115
|
"LM_robustness.py": [
|
|
116
116
|
7.57,
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
0
|
|
146
146
|
],
|
|
147
147
|
"LM_buzzer.py": [
|
|
148
|
-
8.
|
|
148
|
+
8.88,
|
|
149
149
|
0
|
|
150
150
|
],
|
|
151
151
|
"LM_switch.py": [
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
0
|
|
186
186
|
],
|
|
187
187
|
"LM_neoeffects.py": [
|
|
188
|
-
6.
|
|
188
|
+
6.86,
|
|
189
189
|
0
|
|
190
190
|
],
|
|
191
191
|
"LM_i2c.py": [
|
|
@@ -237,7 +237,7 @@
|
|
|
237
237
|
0
|
|
238
238
|
],
|
|
239
239
|
"LM_telegram.py": [
|
|
240
|
-
9.
|
|
240
|
+
9.53,
|
|
241
241
|
0
|
|
242
242
|
],
|
|
243
243
|
"LM_OV2640.py": [
|
|
@@ -315,11 +315,11 @@
|
|
|
315
315
|
},
|
|
316
316
|
"summary": {
|
|
317
317
|
"core": [
|
|
318
|
-
|
|
318
|
+
3276,
|
|
319
319
|
23
|
|
320
320
|
],
|
|
321
321
|
"load": [
|
|
322
|
-
|
|
322
|
+
8939,
|
|
323
323
|
55
|
|
324
324
|
],
|
|
325
325
|
"core_dep": [
|
|
@@ -330,8 +330,8 @@
|
|
|
330
330
|
true,
|
|
331
331
|
6
|
|
332
332
|
],
|
|
333
|
-
"core_score": 9.
|
|
334
|
-
"load_score": 8.
|
|
335
|
-
"version": "2.
|
|
333
|
+
"core_score": 9.06,
|
|
334
|
+
"load_score": 8.22,
|
|
335
|
+
"version": "2.9.1-0"
|
|
336
336
|
}
|
|
337
337
|
}
|
micrOS/source/Common.py
CHANGED
|
@@ -9,8 +9,7 @@ from Logger import logger, log_get
|
|
|
9
9
|
from microIO import resolve_pin
|
|
10
10
|
from Tasks import TaskBase, Manager, lm_exec
|
|
11
11
|
from machine import Pin, ADC
|
|
12
|
-
|
|
13
|
-
TELEGRAM = None
|
|
12
|
+
from Notify import Notify
|
|
14
13
|
|
|
15
14
|
################## Common LM features ##################
|
|
16
15
|
|
|
@@ -78,7 +77,7 @@ class SmartADC:
|
|
|
78
77
|
return {'raw': raw, 'percent': round(percent*100, 1), 'volt': volt}
|
|
79
78
|
|
|
80
79
|
@staticmethod
|
|
81
|
-
def
|
|
80
|
+
def get_instance(pin):
|
|
82
81
|
if pin in SmartADC.OBJS.keys():
|
|
83
82
|
return SmartADC.OBJS[pin]
|
|
84
83
|
SmartADC.OBJS[pin] = SmartADC(pin)
|
|
@@ -141,22 +140,18 @@ def exec_cmd(cmd, skip_check=False):
|
|
|
141
140
|
return lm_exec(cmd) if isinstance(cmd, list) else False, f"Invalid type, must be list: {type(cmd)}"
|
|
142
141
|
|
|
143
142
|
|
|
144
|
-
def notify(text):
|
|
143
|
+
def notify(text=None) -> bool:
|
|
145
144
|
"""
|
|
146
145
|
[LM] micrOS common notification handler (Telegram)
|
|
147
|
-
:param text: notification text
|
|
146
|
+
:param text: notification text / None (return notification state)
|
|
148
147
|
return: verdict: True/False
|
|
149
148
|
"""
|
|
150
|
-
|
|
151
|
-
if
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
TELEGRAM = Telegram()
|
|
155
|
-
except Exception as e:
|
|
156
|
-
errlog_add(f"[ERR] Import Notify.Telegram: {e}")
|
|
157
|
-
return False
|
|
149
|
+
# (1) Return notification state
|
|
150
|
+
if text is None:
|
|
151
|
+
return Notify.GLOBAL_NOTIFY
|
|
152
|
+
# (2) Send notification
|
|
158
153
|
try:
|
|
159
|
-
out =
|
|
154
|
+
out = Notify.notify(text)
|
|
160
155
|
except Exception as e:
|
|
161
156
|
errlog_add(f"[ERR] Notify: {e}")
|
|
162
157
|
out = str(e)
|
|
@@ -165,7 +160,7 @@ def notify(text):
|
|
|
165
160
|
return False
|
|
166
161
|
|
|
167
162
|
|
|
168
|
-
def web_endpoint(endpoint, function):
|
|
163
|
+
def web_endpoint(endpoint, function) -> bool:
|
|
169
164
|
"""
|
|
170
165
|
[LM] Add test endpoint <localhost.local>/endpoint from Load Modules
|
|
171
166
|
:param endpoint: simple string, name of the endpoint
|
micrOS/source/Config.py
CHANGED
|
@@ -13,6 +13,7 @@ Designed by Marcell Ban aka BxNxM
|
|
|
13
13
|
# IMPORTS #
|
|
14
14
|
#################################################################
|
|
15
15
|
from os import remove
|
|
16
|
+
from re import search
|
|
16
17
|
from json import load, dump
|
|
17
18
|
from utime import sleep
|
|
18
19
|
from Debug import DebugCfg, console_write, errlog_add
|
|
@@ -185,6 +186,21 @@ class Data:
|
|
|
185
186
|
# Return default value if key not exists
|
|
186
187
|
return 'n/a'
|
|
187
188
|
|
|
189
|
+
@staticmethod
|
|
190
|
+
def validate_pwd(password):
|
|
191
|
+
"""
|
|
192
|
+
Validate appwd parameter
|
|
193
|
+
- webrepl password
|
|
194
|
+
- micrOS auth password (Shell/WebCli)
|
|
195
|
+
- wifi access point password
|
|
196
|
+
"""
|
|
197
|
+
# Check password rules
|
|
198
|
+
if 4 <= len(password) <= 9:
|
|
199
|
+
if search(r"[A-Z]", password) and search(r"[a-z]", password):
|
|
200
|
+
if search(r"\d", password):
|
|
201
|
+
return True, ''
|
|
202
|
+
return False, 'Password must include [0-9] both [a-z][A-Z] and length between 4-9 char.'
|
|
203
|
+
|
|
188
204
|
|
|
189
205
|
#################################################################
|
|
190
206
|
# CONFIGHANDLER FUNCTIONS #
|
|
@@ -204,8 +220,11 @@ def cfgget(key=None):
|
|
|
204
220
|
errlog_add(f'[ERR] cfgget {key} error: {e}')
|
|
205
221
|
return None
|
|
206
222
|
|
|
207
|
-
|
|
208
223
|
def cfgput(key, value, type_check=False):
|
|
224
|
+
if key == 'appwd':
|
|
225
|
+
is_valid, verdict = Data.validate_pwd(value)
|
|
226
|
+
if not is_valid:
|
|
227
|
+
raise Exception(verdict)
|
|
209
228
|
# Handle special "offloaded" keys
|
|
210
229
|
if str(Data.CONFIG_CACHE.get(key, None)) == '...':
|
|
211
230
|
return Data.disk_keys(key, value)
|
micrOS/source/LM_buzzer.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from sys import platform
|
|
2
2
|
from utime import sleep
|
|
3
3
|
from microIO import resolve_pin, pinmap_search
|
|
4
|
-
from Common import micro_task
|
|
4
|
+
from Common import micro_task, notify
|
|
5
5
|
from Types import resolve
|
|
6
6
|
|
|
7
7
|
|
|
@@ -13,6 +13,7 @@ __BUZZER_OBJ = None
|
|
|
13
13
|
__BUZZER_CACHE = [600]
|
|
14
14
|
__PERSISTENT_CACHE = False
|
|
15
15
|
__TASK_TAG = "buzzer._play"
|
|
16
|
+
CHECK_NOTIFY = False
|
|
16
17
|
|
|
17
18
|
#########################################
|
|
18
19
|
# BUZZER RTTL #
|
|
@@ -229,7 +230,9 @@ def bipp(repeat=1, freq=None):
|
|
|
229
230
|
:param freq int: 0-1000 default: 600
|
|
230
231
|
:return str: Verdict string
|
|
231
232
|
"""
|
|
232
|
-
global __BUZZER_CACHE
|
|
233
|
+
global __BUZZER_CACHE, CHECK_NOTIFY
|
|
234
|
+
if CHECK_NOTIFY and not notify():
|
|
235
|
+
return "NoBipp - notify off"
|
|
233
236
|
# restore data from cache if it was not provided
|
|
234
237
|
freq = int(__BUZZER_CACHE[0] if freq is None else freq)
|
|
235
238
|
for _ in range(repeat):
|
|
@@ -264,6 +267,9 @@ def play(rtttlstr='Indiana'):
|
|
|
264
267
|
:param rtttlstr str: rttl string, default: 'd=4,o=5,b=250:e,8p,8f,8g,8p,1c6,8p.,d,8p,8e,1f,p.'
|
|
265
268
|
:return str: verdict
|
|
266
269
|
"""
|
|
270
|
+
global CHECK_NOTIFY
|
|
271
|
+
if CHECK_NOTIFY and not notify():
|
|
272
|
+
return "NoBipp - notify off"
|
|
267
273
|
state = micro_task(tag=__TASK_TAG, task=_play(rtttlstr))
|
|
268
274
|
if state:
|
|
269
275
|
return 'Play song'
|
|
@@ -277,22 +283,24 @@ def list_tones():
|
|
|
277
283
|
return '\n'.join(list(_builtin_tones()))
|
|
278
284
|
|
|
279
285
|
|
|
280
|
-
def load(cache=None):
|
|
286
|
+
def load(cache=None, check_notify=False):
|
|
281
287
|
"""
|
|
282
288
|
Initialize buzzer module
|
|
283
289
|
:param cache bool: file state machine cache: True/False/None(default: automatic True)
|
|
284
290
|
- Load .pds (state machine cache) for this load module
|
|
285
291
|
- Apply loaded states to gpio pins (boot function)
|
|
286
|
-
:
|
|
292
|
+
:param check_notify: check notify enabled/disabled - make noise if enabled only
|
|
293
|
+
:return str: Verdict
|
|
287
294
|
"""
|
|
288
295
|
from sys import platform
|
|
289
|
-
global __PERSISTENT_CACHE
|
|
296
|
+
global __PERSISTENT_CACHE, CHECK_NOTIFY
|
|
290
297
|
if cache is None:
|
|
291
298
|
__PERSISTENT_CACHE = False if platform == 'esp8266' else True
|
|
292
299
|
else:
|
|
293
300
|
__PERSISTENT_CACHE = cache
|
|
294
301
|
__persistent_cache_manager('r')
|
|
295
|
-
|
|
302
|
+
CHECK_NOTIFY = check_notify
|
|
303
|
+
return f"CACHE: {__PERSISTENT_CACHE}, check notify: {CHECK_NOTIFY}"
|
|
296
304
|
|
|
297
305
|
|
|
298
306
|
#######################
|
|
@@ -319,4 +327,4 @@ def help(widgets=False):
|
|
|
319
327
|
return resolve(('BUTTON bipp repeat=3 freq=600',
|
|
320
328
|
'BUTTON play rtttlstr=<Indiana,TakeOnMe,StarWars,MissionImp>',
|
|
321
329
|
'list_tones',
|
|
322
|
-
'load', 'pinmap'), widgets=widgets)
|
|
330
|
+
'load check_notify=False', 'pinmap'), widgets=widgets)
|
micrOS/source/LM_genIO.py
CHANGED
|
@@ -124,7 +124,7 @@ def get_adc(pin, key=None):
|
|
|
124
124
|
if isinstance(pin, int):
|
|
125
125
|
pin_tag = f"ADC{pin}"
|
|
126
126
|
pin = register_pin(pin_tag, pin)
|
|
127
|
-
data = SmartADC.
|
|
127
|
+
data = SmartADC.get_instance(pin).get()
|
|
128
128
|
data["pin"] = pin
|
|
129
129
|
if key is None:
|
|
130
130
|
return data
|
micrOS/source/LM_neoeffects.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from LM_neopixel import load, segment, Data, status, pinmap as pm
|
|
2
2
|
from random import randint
|
|
3
|
+
from Types import resolve
|
|
4
|
+
from Common import manage_task
|
|
3
5
|
|
|
4
6
|
|
|
5
7
|
#################################
|
|
@@ -285,6 +287,13 @@ def fire(r=None, g=None, b=None, ledcnt=24):
|
|
|
285
287
|
effect.draw(cgen, shift=False)
|
|
286
288
|
return 'fire R{}:G{}:B{} N:{}'.format(r, g, b, effect.pix_cnt)
|
|
287
289
|
|
|
290
|
+
|
|
291
|
+
def stop_effects():
|
|
292
|
+
"""
|
|
293
|
+
Stop all running (neo)effects tasks
|
|
294
|
+
"""
|
|
295
|
+
return manage_task("neoeffects.*", "kill")
|
|
296
|
+
|
|
288
297
|
#######################
|
|
289
298
|
# LM helper functions #
|
|
290
299
|
#######################
|
|
@@ -307,10 +316,16 @@ def help(widgets=False):
|
|
|
307
316
|
(widgets=False) list of functions implemented by this application
|
|
308
317
|
(widgets=True) list of widget json for UI generation
|
|
309
318
|
"""
|
|
310
|
-
return 'meteor r=<0-255> g=<0-255> b=<0-255> shift=True ledcnt=24'
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
319
|
+
return resolve(('meteor r=<0-255> g=<0-255> b=<0-255> shift=True ledcnt=24',
|
|
320
|
+
'BUTTON meteor &&',
|
|
321
|
+
'cycle r g b shift=True ledcnt=24',
|
|
322
|
+
'BUTTON cycle &&50',
|
|
323
|
+
'rainbow step=1 br=<5-100> ledcnt=24 &&',
|
|
324
|
+
'BUTTON rainbow br=50 &&',
|
|
325
|
+
'fire r=None g=None b=None ledcnt=24',
|
|
326
|
+
'BUTTON fire &&200',
|
|
327
|
+
'BUTTON stop_effects',
|
|
328
|
+
'shader size=4 offset=0 shift=True ledcnt=24',
|
|
329
|
+
'random max_val=255',
|
|
330
|
+
'pinmap',
|
|
331
|
+
'COLOR color r=<0-255-10> g b'), widgets=widgets)
|
micrOS/source/LM_neopixel.py
CHANGED
|
@@ -345,7 +345,7 @@ def help(widgets=False):
|
|
|
345
345
|
'BUTTON toggle state=<True,False> smooth=True',
|
|
346
346
|
'load ledcnt=24',
|
|
347
347
|
'SLIDER brightness percent=<0-100> smooth=True wake=True',
|
|
348
|
-
'
|
|
348
|
+
'segment r g b s=<0-n>',
|
|
349
349
|
'transition r g b sec=1.0 wake=False',
|
|
350
350
|
'BUTTON random smooth=True max_val=254',
|
|
351
351
|
'status',
|
micrOS/source/LM_ph_sensor.py
CHANGED
|
@@ -12,7 +12,7 @@ ADC.ATTN_11DB — the full range voltage: 3.3V
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def __measure(samples=10):
|
|
15
|
-
adc_obj = SmartADC.
|
|
15
|
+
adc_obj = SmartADC.get_instance(resolve_pin('ph'))
|
|
16
16
|
mbuf = 0
|
|
17
17
|
for k in range(0, samples):
|
|
18
18
|
mbuf += adc_obj.get()['volt']
|
|
@@ -22,7 +22,7 @@ def __measure(samples=10):
|
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
def measure():
|
|
25
|
-
data = SmartADC.
|
|
25
|
+
data = SmartADC.get_instance(resolve_pin('ph')).get()
|
|
26
26
|
return "ADC data: {}\nAVG V: {}".format(data, __measure())
|
|
27
27
|
|
|
28
28
|
|
micrOS/source/LM_presence.py
CHANGED
|
@@ -96,7 +96,7 @@ async def __task(ms_period, buff_size):
|
|
|
96
96
|
|
|
97
97
|
if Data.MIC_TYPE == Data.MIC_TYPES['ADC']:
|
|
98
98
|
# Create ADC object
|
|
99
|
-
Data.MIC_ADC = SmartADC.
|
|
99
|
+
Data.MIC_ADC = SmartADC.get_instance(resolve_pin('mic'))
|
|
100
100
|
elif Data.MIC_TYPE == Data.MIC_TYPES['I2S']:
|
|
101
101
|
if Data.I2S_MIC is None:
|
|
102
102
|
import LM_i2s_mic
|
micrOS/source/LM_system.py
CHANGED
|
@@ -7,6 +7,7 @@ from Network import get_mac, ifconfig as network_config
|
|
|
7
7
|
from Time import ntp_time, set_time, uptime
|
|
8
8
|
from Tasks import Manager
|
|
9
9
|
from Types import resolve
|
|
10
|
+
from Notify import Notify
|
|
10
11
|
|
|
11
12
|
try:
|
|
12
13
|
from gc import mem_free, mem_alloc, collect
|
|
@@ -177,15 +178,16 @@ def list_stations():
|
|
|
177
178
|
return [("NoAP", '')]
|
|
178
179
|
|
|
179
180
|
|
|
180
|
-
def pinmap(
|
|
181
|
+
def pinmap(keys='builtin irq1 irq2 irq3 irq4'):
|
|
181
182
|
"""
|
|
182
183
|
Get Logical pin by key runtime
|
|
183
|
-
:param
|
|
184
|
+
:param keys str: logical pin name or names to resolve
|
|
184
185
|
:return dict: key map
|
|
185
186
|
"""
|
|
186
187
|
from microIO import pinmap_search, pinmap_info
|
|
187
188
|
map = pinmap_info()
|
|
188
|
-
|
|
189
|
+
keys = keys.split()
|
|
190
|
+
map["search"] = pinmap_search(keys)
|
|
189
191
|
return map
|
|
190
192
|
|
|
191
193
|
@socket_stream
|
|
@@ -232,6 +234,14 @@ def urequests_host_cache():
|
|
|
232
234
|
return host_cache()
|
|
233
235
|
|
|
234
236
|
|
|
237
|
+
def notifications(enable=None):
|
|
238
|
+
"""
|
|
239
|
+
Global notifications control for micrOS
|
|
240
|
+
:param enable: True: Enable notifications / False: Disable notifications
|
|
241
|
+
return: state verdict
|
|
242
|
+
"""
|
|
243
|
+
return Notify.notifications(state=enable)
|
|
244
|
+
|
|
235
245
|
#######################
|
|
236
246
|
# LM helper functions #
|
|
237
247
|
#######################
|
|
@@ -246,5 +256,6 @@ def help(widgets=False):
|
|
|
246
256
|
return resolve(('info', 'TEXTBOX top', 'gclean', 'heartbeat', 'clock',
|
|
247
257
|
'setclock year month mday hour min sec',
|
|
248
258
|
'ntp', 'rssi', 'list_stations', 'pinmap key="dhtpin"/None', 'alarms clean=False',
|
|
259
|
+
'notifications enable=<None,True,False>',
|
|
249
260
|
'sun refresh=False', 'ifconfig', 'memory_usage',
|
|
250
261
|
'disk_usage', 'dat_dump', 'urequests_host_cache'), widgets=widgets)
|