From 379f85749ce88c06973ffcb04d53350986639d01 Mon Sep 17 00:00:00 2001 From: Franziska Kunsmann Date: Tue, 14 Mar 2023 13:40:56 +0100 Subject: [PATCH] hide empty location --- node.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/node.lua b/node.lua index f5d4af8..80ba863 100644 --- a/node.lua +++ b/node.lua @@ -3,7 +3,7 @@ util.init_hosted() local json = require "json" local serial = sys.get_env "SERIAL" -local location = "" +local location = "" local description = "" util.data_mapper{ @@ -28,7 +28,12 @@ function node.render() -- lower: 707 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) font:write(960-(upper_width/2), 631, upper_text, 40, 1,1,1,1)