mirror of
https://github.com/joBr99/nspanel-lovelace-ui.git
synced 2025-12-19 22:24:15 +01:00
add tapp file for testing
This commit is contained in:
@@ -321,7 +321,7 @@ tasmota.add_driver(nextion)
|
||||
|
||||
def get_current_version(cmd, idx, payload, payload_json)
|
||||
import string
|
||||
var version_of_this_script = 7
|
||||
var version_of_this_script = 8
|
||||
var jm = string.format("{\"nlui_driver_version\":\"%s\"}", version_of_this_script)
|
||||
tasmota.publish_result(jm, "RESULT")
|
||||
end
|
||||
@@ -330,10 +330,28 @@ tasmota.add_cmd('GetDriverVersion', get_current_version)
|
||||
|
||||
def update_berry_driver(cmd, idx, payload, payload_json)
|
||||
def task()
|
||||
import path
|
||||
import string
|
||||
if path.exists("nsp-lovelace-driver.tapp")
|
||||
var r = string.find(payload, ".tapp")
|
||||
if r < 0
|
||||
print("URL doesn't contain .tapp skipping update")
|
||||
else
|
||||
r = tasmota.urlfetch(payload, "nsp-lovelace-driver.tapp")
|
||||
if r < 0
|
||||
print("Update failed")
|
||||
else
|
||||
tasmota.cmd("Restart 1")
|
||||
end
|
||||
end
|
||||
else
|
||||
var r = string.find(payload, ".be")
|
||||
if r < 0
|
||||
print("URL doesn't contain .be skipping update")
|
||||
else
|
||||
var cl = webclient()
|
||||
cl.begin(payload)
|
||||
var r = cl.GET()
|
||||
r = cl.GET()
|
||||
if r == 200
|
||||
print("Sucessfully downloaded nspanel-lovelace-ui berry driver")
|
||||
else
|
||||
@@ -344,15 +362,9 @@ def update_berry_driver(cmd, idx, payload, payload_json)
|
||||
print("Error while writeing nspanel-lovelace-ui berry driver")
|
||||
else
|
||||
print("Sucessfully written nspanel-lovelace-ui berry driver")
|
||||
var s = load('autoexec.be')
|
||||
if s == true
|
||||
var jm = string.format("{\"nlui_driver_update\":\"%s\"}", "succeeded")
|
||||
tasmota.publish_result(jm, "RESULT")
|
||||
else
|
||||
var jm = string.format("{\"nlui_driver_update\":\"%s\"}", "failed")
|
||||
tasmota.publish_result(jm, "RESULT")
|
||||
tasmota.cmd("Restart 1")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
tasmota.set_timer(0,task)
|
||||
|
||||
BIN
tasmota/nsp-lovelace-driver.tapp
Normal file
BIN
tasmota/nsp-lovelace-driver.tapp
Normal file
Binary file not shown.
Reference in New Issue
Block a user