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"

View File

@@ -28,6 +28,15 @@ local buttons_cmds = { prev_cmd, backward_cmd, play_cmd, stop_cmd, forward_cmd,
local url = nil
local curr_idx = nil
function on_preview()
if next(settings:get()) == nil then
ui:show_text("Remote control for Kodi multimedia player")
return
else
on_resume()
end
end
function on_resume()
if next(settings:get()) == nil then
ui:show_text("Tap to enter Kodi address")

View File

@@ -7,6 +7,10 @@
current_output = "Click to enter command"
function on_preview()
ui:show_text("Shows the result of executing console commands")
end
function on_resume()
redraw()
end

View File

@@ -4,17 +4,11 @@
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
-- version = "1.0"
ticks = -1
function on_tick()
-- Update one time per 10 seconds
ticks = ticks + 1
function on_tick(ticks)
if ticks % 10 ~= 0 then
return
end
ticks = 0
local info = system:system_info()
local strings = stringify_table(info)

View File

@@ -14,6 +14,15 @@ local api_url = "https://api.uptimerobot.com/v2/"
local click_url = "https://uptimerobot.com/dashboard#mainDashboard"
local media_type = "application/x-www-form-urlencoded"
function on_preview()
if (next(settings:get()) == nil) then
ui:show_text("Shows uptime information from uptimerobot.com")
return
else
on_alarm()
end
end
function on_alarm()
if (next(settings:get()) == nil) then
ui:show_text("Tap to enter API key")