center device info if no location is set
This commit is contained in:
parent
a3a3e64071
commit
6f16a9fcfb
1 changed files with 4 additions and 1 deletions
5
node.lua
5
node.lua
|
@ -29,11 +29,14 @@ function node.render()
|
||||||
|
|
||||||
upper_text = description .. " (" .. serial .. ")"
|
upper_text = description .. " (" .. serial .. ")"
|
||||||
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)
|
|
||||||
|
|
||||||
if location ~= nil and location ~= '' then
|
if location ~= nil and location ~= '' then
|
||||||
|
font:write(960-(upper_width/2), 631, upper_text, 40, 1,1,1,1)
|
||||||
|
|
||||||
lower_text = location .. " - Serial " .. serial
|
lower_text = location .. " - Serial " .. serial
|
||||||
lower_width = font:width(lower_text, 20)
|
lower_width = font:width(lower_text, 20)
|
||||||
font:write(960-(lower_width/2), 679, lower_text, 20, 1,1,1,1)
|
font:write(960-(lower_width/2), 679, lower_text, 20, 1,1,1,1)
|
||||||
|
else
|
||||||
|
font:write(960-(upper_width/2), 645, upper_text, 40, 1,1,1,1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue