summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mtx-context-domotica.tex
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/mtx-context-domotica.tex')
-rw-r--r--tex/context/base/mkiv/mtx-context-domotica.tex48
1 files changed, 41 insertions, 7 deletions
diff --git a/tex/context/base/mkiv/mtx-context-domotica.tex b/tex/context/base/mkiv/mtx-context-domotica.tex
index a904d865b..62e6e8786 100644
--- a/tex/context/base/mkiv/mtx-context-domotica.tex
+++ b/tex/context/base/mkiv/mtx-context-domotica.tex
@@ -23,11 +23,13 @@
% --verycompact : small margins, 7pt font
%
% --openzwave : process openzwave xml files
+% --hue : process hue task file
%
% --pattern=spec : files to process
%
% example: context --extra=domotica --openzwave ./config/fibaro/fgms.xml ./open-zwave-master/config/aeotec/zw100.xml
% example: context --extra=domotica --openzwave --pattern="./open-zwave-master/config/**.xml"
+% example: context --extra=domotica --hue hue-pragma-tasks.lua
%
% end help
@@ -64,7 +66,12 @@
[\getdocumentargument{paperformat_paper}]
[\getdocumentargument{paperformat_print}]
+\setuphead
+ [section]
+ [style=bold]
+
\doifdocumentargument {openzwave} {\enablemode[openzwave]}
+\doifdocumentargument {hue} {\enablemode[hue]}
\startmode[openzwave]
@@ -79,18 +86,11 @@
[section]
[width=4em]
- \setuphead
- [section]
- [style=bold]
-
\setupheadertexts
\setupheadertexts
[chapter][pagenumber]
- \setupheader
- [style=bold]
-
\starttitle[title=Zwave devices]
\placelist[chapter,section]
@@ -131,3 +131,37 @@
\stopmode
+\startmode[hue]
+
+ \starttext
+
+ \setupheadertexts
+
+ \startluacode
+
+ local arguments = document.arguments
+ local files = document.files
+ local pattern = arguments.pattern
+ local filename = files[1]
+
+ if filename then
+ context.starttitle { title = "Hue: " .. file.nameonly(filename) }
+ filename = file.addsuffix(filename,"lua")
+ if lfs.isfile(filename) then
+ moduledata.hue.show_state(filename)
+ else
+ context("unknown file %a",filename)
+ end
+ context.stoptitle()
+ else
+ context("no files given")
+ context.stoptitle()
+ end
+
+ \stopluacode
+
+ \stoptext
+
+\stopmode
+
+