-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathautoexec.be
63 lines (45 loc) · 1.19 KB
/
autoexec.be
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# autoexec.be is automatically loaded at startup
import string
appName="ExtSensor"
# tasmota.wd is only valid at startup step
tasmotawd = tasmota.wd
# needed to import modules located in tapp file
def push_path()
import sys
var p = tasmotawd
var path = sys.path()
if path.find(p) == nil
path.push(p)
end
end
def xload(name,useRoot)
var result=false
if useRoot
result = load(name)
else
result = load(tasmotawd + name)
end
print("loaded",name," with result:"+str(result))
end
print("autoexec - start with app-file:"+tasmotawd)
# change to path where tapp files are located
push_path()
# no import your one module which is part of the tapp-file
# this is the first time loaded in cache, so following 'import' commands can work
import tool
# define types
xload("git.be")
xload("Libs.be")
xload("UdpBroker.be")
xload("ExtSensor.be")
# define global variables
xload("configure01.be")
# loader user's input and adjustings
xload(appName+"01.be",true)
# shortcut for test device
if tasmota.cmd("DeviceName")["DeviceName"] == "Tasmota Testing"
return
end
xload("configure02.be")
# settings after initializations
xload(appName+"02.be",true)