hide empty location

This commit is contained in:
Franzi 2023-03-14 13:40:56 +01:00
parent db856a70c7
commit 379f85749c
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -3,7 +3,7 @@ util.init_hosted()
local json = require "json" local json = require "json"
local serial = sys.get_env "SERIAL" local serial = sys.get_env "SERIAL"
local location = "<please wait>" local location = ""
local description = "<please wait>" local description = "<please wait>"
util.data_mapper{ util.data_mapper{
@ -28,7 +28,12 @@ function node.render()
-- lower: 707 -- lower: 707
upper_text = "C3VOC: " .. description upper_text = "C3VOC: " .. description
lower_text = location .. " - Serial " .. serial
if location == nil or location == '' then
lower_text = "Serial " .. serial
else
lower_text = location .. " - Serial " .. serial
end
upper_width = font:width(upper_text, 40) upper_width = font:width(upper_text, 40)
font:write(960-(upper_width/2), 631, upper_text, 40, 1,1,1,1) font:write(960-(upper_width/2), 631, upper_text, 40, 1,1,1,1)