%# hmi.htm -%> <% ---------------------- -- Poste seleccionado ---------------------- local path = luci.dispatcher.context.requestpath local fs = require "nixio.fs" local cl = path[1] local utl = require "luci.util" local mUtl = require "luci.moreUtils" local sn = mUtl.get_serialnumber() local pricingd_vars = require "luci.model.pricingd" if params and params.pdr then params = params.pdr end local master = mUtl.identify_pseudo_maestre(path[3] or sn) local method if master == true then method = "pricingd" else method = (path[3] or sn).. "/pricingd" end local options = utl.ubus(method , "get_configuration") local cost_methoda if options and options.cost_method then cost_method = options.cost_method end local all_opts = {} local discount_periods = {} if options then for k , v in pairs (options) do if type(v) ~= "table" then if k~= "debuglevel" then all_opts[k] = v end else if k ~= "discount_periods" then for z, t in pairs (v) do if type(t) == "table" then for n,m in pairs (t) do if cost_method ~= "california" then if (n == "charging_rate" or n == "discount_charging_rate") and string.find(z,"mennekes") then all_opts[n.."_ac"] = m elseif ( n == "charging_rate" or n == "discount_charging_rate") then all_opts[n.."_dc"] = m else if n ~= "credit" then all_opts[n] = m end end elseif cost_method == "california" and (z == "default_charging" or z == "default_idle" ) then if z == "default_idle" and n == "hourPrice" then n = "hourPrice_idle" elseif z == "default_charging" and n == "hourPrice" then n = "hourPrice_charging" end all_opts[n] = m end end end end else for z, t in pairs (v) do discount_periods[z] = t end end end end end -%> <%+header%>