add battery widget (fix)

This commit is contained in:
Evgeny
2021-08-31 11:09:15 +03:00
parent 35e0e33e61
commit 5ece22761a

View File

@@ -1,6 +1,15 @@
-- name = "Battery info" -- name = "Battery info"
function on_resume() ticks = 0
function on_tick()
-- Update one time per 10 seconds
if ticks % 10 ~= 0 then
return
end
ticks = 0
local batt_info = system:get_battery_info() local batt_info = system:get_battery_info()
local batt_strings = stringify_table(batt_info) local batt_strings = stringify_table(batt_info)
ui:show_lines(batt_strings) ui:show_lines(batt_strings)