Various fixes to support new AIO version

This commit is contained in:
Evgeny
2023-09-11 11:36:09 +04:00
parent 5ad5be396f
commit de23ba41de
5 changed files with 24 additions and 13 deletions

View File

@@ -2,17 +2,12 @@
-- description = "Simple battery info widget"
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
ticks = -1
function on_tick()
function on_tick(ticks)
-- Update one time per 10 seconds
ticks = ticks + 1
if ticks % 10 ~= 0 then
return
end
ticks = 0
local batt_info = system:battery_info()
local batt_strings = stringify_table(batt_info)
local folded_str = "Battery: "..batt_info.percent.."% | "..batt_info.temp.."° | "..batt_info.voltage.." mV"