30 lines
644 B
Plaintext
30 lines
644 B
Plaintext
|
|
var name = nil # will use tasmota device name unless string given here
|
|
|
|
debug = [false,false,false,false]
|
|
|
|
# use in development with the utils.tapp bundle
|
|
# import sys
|
|
# sys.path().push('utils.tapp#')
|
|
|
|
import weather
|
|
var w
|
|
|
|
def run()
|
|
tasmota.remove_rule('Wifi#Connected', 2)
|
|
print('wifi now connected, staring weather app', tasmota.wifi())
|
|
w=weather.create({'name': name})
|
|
end
|
|
|
|
if tasmota.wifi().find('mac')
|
|
print('wifi already connected, starting app')
|
|
w=weather.create({'name': name})
|
|
else
|
|
print('waiting for wifi to connect')
|
|
tasmota.add_rule('Wifi#Connected' , run)
|
|
end
|
|
|
|
def _r ()
|
|
tasmota.cmd('restart 99')
|
|
end
|