diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-11-14 14:35:42 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-11-14 14:35:42 +0100 |
commit | 6f55552ca1456f0a2d50d1d0fdc8dc813d9ace77 (patch) | |
tree | 4be2ae8eabfd71f42977c74055b2f15d4f253d7b /scripts/context/lua/mtx-youless.lua | |
parent | 3c5bdb02c68293a907c765f109641c3939c13f6c (diff) | |
download | context-6f55552ca1456f0a2d50d1d0fdc8dc813d9ace77.tar.gz |
2017-11-14 13:58:00
Diffstat (limited to 'scripts/context/lua/mtx-youless.lua')
-rw-r--r-- | scripts/context/lua/mtx-youless.lua | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/scripts/context/lua/mtx-youless.lua b/scripts/context/lua/mtx-youless.lua index 6c600517a..c66824365 100644 --- a/scripts/context/lua/mtx-youless.lua +++ b/scripts/context/lua/mtx-youless.lua @@ -61,13 +61,16 @@ local report = application.report scripts = scripts or { } scripts.youless = scripts.youless or { } +local arguments = environment.arguments +local files = environment.files + function scripts.youless.collect() - local host = environment.arguments.host - local nobackup = environment.arguments.nobackup - local nofile = environment.arguments.nofile - local password = environment.arguments.password - local filename = environment.files[1] - local delay = tonumber(environment.delay) or 12*60*60 + local host = arguments.host + local nobackup = arguments.nobackup + local nofile = arguments.nofile + local password = arguments.password + local filename = files[1] + local delay = tonumber(arguments.delay) or 12*60*60 local function fetch(filename,variant) local data = utilities.youless.collect { @@ -99,7 +102,7 @@ function scripts.youless.collect() report("not backing up data file") end - if environment.arguments.auto then + if arguments.auto then local filename_kwh = formatters["%s-kwh.lua" ](filename ~= "" and filename or "youless") local filename_watt = formatters["%s-watt.lua"](filename ~= "" and filename or "youless") while true do |