From 6f16a9fcfb543a425d9a5e79c2f379e81bbedd06 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Sat, 3 Jun 2023 19:07:13 +0200 Subject: [PATCH] center device info if no location is set --- node.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/node.lua b/node.lua index 4441800..d908cad 100644 --- a/node.lua +++ b/node.lua @@ -29,11 +29,14 @@ function node.render() upper_text = description .. " (" .. serial .. ")" 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 + font:write(960-(upper_width/2), 631, upper_text, 40, 1,1,1,1) + lower_text = location .. " - Serial " .. serial lower_width = font:width(lower_text, 20) 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