From e750ffe69ddce66aa64ba75ea750a18b24dda052 Mon Sep 17 00:00:00 2001 From: Mikayla Fischler Date: Sat, 27 Jul 2024 16:23:37 -0400 Subject: [PATCH] updated element asserts for power indicator and incremented graphics version --- graphics/core.lua | 2 +- graphics/elements/indicators/power.lua | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/graphics/core.lua b/graphics/core.lua index f6a647a..4bb0298 100644 --- a/graphics/core.lua +++ b/graphics/core.lua @@ -7,7 +7,7 @@ local flasher = require("graphics.flasher") local core = {} -core.version = "2.3.0" +core.version = "2.3.1" core.flasher = flasher core.events = events diff --git a/graphics/elements/indicators/power.lua b/graphics/elements/indicators/power.lua index adcd100..7a09f95 100644 --- a/graphics/elements/indicators/power.lua +++ b/graphics/elements/indicators/power.lua @@ -24,8 +24,9 @@ local element = require("graphics.element") ---@param args power_indicator_args ---@return graphics_element element, element_id id local function power(args) - element.assert(type(args.value) == "number", "value is a required field") + element.assert(type(args.label) == "string", "label is a required field") element.assert(type(args.unit) == "string", "unit is a required field") + element.assert(type(args.value) == "number", "value is a required field") element.assert(util.is_int(args.width), "width is a required field") args.height = 1