From 1a95c7474c30a8b995743145b002d54e91777710 Mon Sep 17 00:00:00 2001 From: Nathaniel Wesley Filardo Date: Sat, 23 Jan 2021 01:24:36 +0000 Subject: [PATCH] telnetd integration: more generic "lamp" directive --- mklfs.sh | 2 +- pushall.sh | 2 +- telnetd-cap.lua | 3 --- telnetd-lamp.lua | 11 +++++++++++ 4 files changed, 13 insertions(+), 5 deletions(-) delete mode 100644 telnetd-cap.lua create mode 100644 telnetd-lamp.lua 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 +} -- 2.50.1