end
function get_display_config()
+
width = tonumber(uci.get(config_name,"display","width"))
height = tonumber(uci.get(config_name,"display","height"))
charwidth = tonumber(uci.get(config_name,"display","charwidth"))
charheight = tonumber(uci.get(config_name,"display","charheight"))
- cols = tonumber(uci.get(config_name,"display","columns"))
title = uci.get(config_name,"display","title")
- col_width = math.floor(width/cols)
pages = {}
pagetitles = {}
pagedurations = {}
+ pagecolumns = {}
+ pagecolwidth = {}
local page, def, line, col, pos
cur.foreach(config_name,"display", function(s)
page = {}
+ local columns = s["columns"]
+ if not columns or columns == "" then
+ columns = 1
+ else
+ columns = tonumber(columns)
+ end
local pagetitle = s["title"]
if not pagetitle then
pagetitle = title
page[#page+1] = def
end
col = col + 1
- if col > cols then
+ if col > columns then
col = 1
line = line + 1
end
pages[#pages+1] = page
pagetitles[#pages] = pagetitle
pagedurations[#pages] = pageduration
+ pagecolumns[#pages] = columns
+ pagecolwidth[#pages] = math.floor(width/columns)
end)
end
function process_vals(vals)
for i,page in pairs(pages) do
+ col_width = pagecolwidth[i]
local pageid = "page"..trim(tostring(i))
for j,def in pairs(page) do
val = vals[def["sensor"]][def["param"]]
option port 13666
option width 20
option height 4
- option columns 1
option charwidth 5
option charheight 8
option title "WeatherMonitor"
option graph_duration 20
+config display
+ option title "WeatherMonitor"
+ option duration 40
+ option columns 2
+ list parameter "BME280:TEMPERATURE::C:1:1:5"
+ list parameter "BME280:HUMIDITY::%:1:1:5"
+ list parameter "BME280:PRESSURE::mm:0.75:0:4"
+ list parameter ""
+ list parameter "MHZ19:CO2PPM:CO2:ppm:1:0:4"
+ list parameter "CCS811:VOCPPB:Gas:ppb:1:0:5"
+
config display
option title "Weather (BME280)"
- option duration 40
+ option duration 20
+ option columns 1
list parameter "BME280:TEMPERATURE:Temperature:C:1:1:5"
list parameter "BME280:HUMIDITY:Humidity :%:1:1:5"
list parameter "BME280:PRESSURE:Pressure :mm:0.75:0:4"
config display
option title "Athmosphere"
- option duration 40
+ option columns 1
+ option duration 20
list parameter "MHZ19:CO2PPM:CO2 :ppm:1:0:5"
list parameter "CCS811:VOCPPB:Gas :ppb:1:0:5"