From: Nathaniel Wesley Filardo Date: Sat, 23 Jan 2021 01:24:36 +0000 (+0000) Subject: telnetd integration: more generic "lamp" directive X-Git-Url: https://hydra-www.ietfng.org/gitweb/?a=commitdiff_plain;h=1a95c7474c30a8b995743145b002d54e91777710;p=acmetensortoys-esp-lua_lamp telnetd integration: more generic "lamp" directive --- diff --git a/mklfs.sh b/mklfs.sh index fe80a36..bb4f59c 100755 --- a/mklfs.sh +++ b/mklfs.sh @@ -18,7 +18,7 @@ SOURCES=( init-early.lua lamp-remote.lua lamp-touch.lua - telnetd-cap.lua + telnetd-lamp.lua draw-*.lua ) diff --git a/pushall.sh b/pushall.sh index 57d3933..c903d77 100755 --- a/pushall.sh +++ b/pushall.sh @@ -16,7 +16,7 @@ fi dopushcompile lamp-touch.lua dopushcompile lamp-remote.lua -dopushcompile telnetd-cap.lua +dopushcompile telnetd-lamp.lua #dopushtext conf/nwfmqtt.conf #dopushtext conf/nwfmqtt.subs dopushlua init-early.lua diff --git a/telnetd-cap.lua b/telnetd-cap.lua deleted file mode 100644 index 445e1b6..0000000 --- a/telnetd-cap.lua +++ /dev/null @@ -1,3 +0,0 @@ -return { - ["calibrate"] = function(_,s) OVL["cap1188-init"]().calibrate() end -} diff --git a/telnetd-lamp.lua b/telnetd-lamp.lua new file mode 100644 index 0000000..428e174 --- /dev/null +++ b/telnetd-lamp.lua @@ -0,0 +1,11 @@ +return { + ["calibrate"] = function(_,s) OVL["cap1188-init"]().calibrate() end, + + ["status"] = function(_,s) + s(("black: %s; dim: %d; fb: %s"):format( + isblackout and "true" or "false", + dimfactor, + (ledfb == remotefb) and "remote" or "local" + )) + end +}