diff --git a/raw/esp32c3/Winky/autoexec.be b/raw/esp32c3/Winky/autoexec.be index 127d63ab..76ec1ef1 100644 --- a/raw/esp32c3/Winky/autoexec.be +++ b/raw/esp32c3/Winky/autoexec.be @@ -1,2 +1,2 @@ # load Winky teleinfo driver -load("teleinfo.be") +#load("teleinfo.be") diff --git a/raw/esp32c3/Winky/cp2fs.be b/raw/esp32c3/Winky/cp2fs.be new file mode 100644 index 00000000..41dea9a7 --- /dev/null +++ b/raw/esp32c3/Winky/cp2fs.be @@ -0,0 +1,36 @@ +# Copy teleinfo driver to file system to be end user editable + +# simple function to copy from autoconfig archive to filesystem +# return true if ok +def cp(from, to) + import path + if to == nil to = from end # to is optional + tasmota.log("OTA: copying "+tasmota.wd + to, 2) + if !path.exists(to) + try + # tasmota.log("f_in="+tasmota.wd + from) + var f_in = open(tasmota.wd + from) + var f_content = f_in.readbytes() + f_in.close() + var f_out = open(to, "w") + f_out.write(f_content) + f_out.close() + except .. as e,m + tasmota.log("OTA: Couldn't copy "+to+" "+e+" "+m,2) + return false + end + return true + end + return true +end + +import path + +# copy some samples files from autoconf +# to filesystem for end user speed up learn +var ok +ok = cp("autoexec.be") +ok = cp("teleinfo.be") + + +# Done diff --git a/raw/esp32c3/Winky/init.bat b/raw/esp32c3/Winky/init.bat index 63381cd4..a071fe0f 100644 --- a/raw/esp32c3/Winky/init.bat +++ b/raw/esp32c3/Winky/init.bat @@ -1,3 +1,4 @@ +Br load("Winky.autoconf#cp2fs.be") Template {"NAME":"Winky","GPIO":[1,4704,1376,5632,4705,640,608,1,1,32,1,0,0,0,0,0,0,0,1,1,1,1],"FLAG":0,"BASE":1} Module 0