summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2013-12-02 16:40:20 +0200
committerMarius <mariausol@gmail.com>2013-12-02 16:40:20 +0200
commite1919e77f8fa775a3434f7bd7ee23100d6b4d527 (patch)
tree2e786197ec97cc94d004d367df054db9e16cc321 /scripts
parentdcde325d302ac7158a5e49d129cfff47c499f0e7 (diff)
downloadcontext-e1919e77f8fa775a3434f7bd7ee23100d6b4d527.tar.gz
beta 2013.12.02 15:22
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/mtx-youless.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/context/lua/mtx-youless.lua b/scripts/context/lua/mtx-youless.lua
index eace4278a..1ffac0336 100644
--- a/scripts/context/lua/mtx-youless.lua
+++ b/scripts/context/lua/mtx-youless.lua
@@ -1,6 +1,6 @@
if not modules then modules = { } end modules ['mtx-youless'] = {
version = 1.002,
- comment = "script tp fetch data from kwk meter polling device",
+ comment = "script tp fetch data from kwh meter polling device",
author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
copyright = "PRAGMA ADE",
license = "see context related readme files"
@@ -12,6 +12,8 @@ if not modules then modules = { } end modules ['mtx-youless'] = {
require("util-you")
+local formatters = string.formatters
+
-- the script
local helpinfo = [[
@@ -28,7 +30,7 @@ local helpinfo = [[
<flag name="collect"><short>collect data from device</short></flag>
<flag name="nobackup"><short>don't backup old datafile</short></flag>
<flag name="nofile"><short>don't write data to file (for checking)</short></flag>
- <flag name="kwh"><short>summative kwk data</short></flag>
+ <flag name="kwh"><short>summative kwh data</short></flag>
<flag name="watt"><short>collected watt data</short></flag>
<flag name="host"><short>ip address of device</short></flag>
</subcategory>
@@ -38,7 +40,7 @@ local helpinfo = [[
<category>
<title>Example</title>
<subcategory>
- <example><command>mtxrun --script youless --collect --host=192.168.2.50 --kwk</command></example>
+ <example><command>mtxrun --script youless --collect --host=192.168.2.50 --kwh</command></example>
<example><command>mtxrun --script youless --collect --host=192.168.2.50 --watt somefile.lua</command></example>
</subcategory>
</category>
@@ -62,6 +64,7 @@ function scripts.youless.collect()
local variant = environment.arguments.kwh and "kwh" or environment.arguments.watt and "watt"
local nobackup = environment.arguments.nobackup
local nofile = environment.arguments.nofile
+ local password = environment.arguments.password
local filename = environment.files[1]
if not variant then
report("provide variant --kwh or --watt")
@@ -89,6 +92,7 @@ function scripts.youless.collect()
host = host,
variant = variant,
nobackup = nobackup,
+ password = password,
}
if type(data) ~= "table" then
report("no data collected")