]> hydra-www.ietfng.org Git - acmetensortoys-esp-lua_lamp/commitdiff
Make linux-draw understand -v from mosquitto_sub
authorNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Sat, 23 Dec 2017 03:59:04 +0000 (22:59 -0500)
committerNathaniel Wesley Filardo <nwf@cs.jhu.edu>
Sat, 23 Dec 2017 03:59:04 +0000 (22:59 -0500)
linux-draw.lua

index ca81eed1dbef6ab20bddf040246ab8d6414541af..f5463c8a12fc501b1aee02de4401f36a2db1f0eb 100644 (file)
@@ -98,8 +98,9 @@ cqc:wrap(function()
     cq.poll({ pollfd = 0, events = 'r' })
     local line = io.read() -- XXX :(
     if line == nil or line == "" then return end
-       printerr("line: " .. line)
-    dofile("lamp-remote.lua")(line)
+    printerr("line: " .. line)
+    local from, cmd = line:match("^(%S+)%s+(.*)$")
+    dofile("lamp-remote.lua")(cmd)
   end
 end)
 io.stdout:setvbuf("no")