Various fixes to support new AIO version
This commit is contained in:
@@ -2,17 +2,12 @@
|
|||||||
-- description = "Simple battery info widget"
|
-- description = "Simple battery info widget"
|
||||||
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
|
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
|
||||||
|
|
||||||
ticks = -1
|
function on_tick(ticks)
|
||||||
|
|
||||||
function on_tick()
|
|
||||||
-- Update one time per 10 seconds
|
-- Update one time per 10 seconds
|
||||||
ticks = ticks + 1
|
|
||||||
if ticks % 10 ~= 0 then
|
if ticks % 10 ~= 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
ticks = 0
|
|
||||||
|
|
||||||
local batt_info = system:battery_info()
|
local batt_info = system:battery_info()
|
||||||
local batt_strings = stringify_table(batt_info)
|
local batt_strings = stringify_table(batt_info)
|
||||||
local folded_str = "Battery: "..batt_info.percent.."% | "..batt_info.temp.."° | "..batt_info.voltage.." mV"
|
local folded_str = "Battery: "..batt_info.percent.."% | "..batt_info.temp.."° | "..batt_info.voltage.." mV"
|
||||||
|
|||||||
@@ -28,6 +28,15 @@ local buttons_cmds = { prev_cmd, backward_cmd, play_cmd, stop_cmd, forward_cmd,
|
|||||||
local url = nil
|
local url = nil
|
||||||
local curr_idx = 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()
|
function on_resume()
|
||||||
if next(settings:get()) == nil then
|
if next(settings:get()) == nil then
|
||||||
ui:show_text("Tap to enter Kodi address")
|
ui:show_text("Tap to enter Kodi address")
|
||||||
|
|||||||
@@ -7,6 +7,10 @@
|
|||||||
|
|
||||||
current_output = "Click to enter command"
|
current_output = "Click to enter command"
|
||||||
|
|
||||||
|
function on_preview()
|
||||||
|
ui:show_text("Shows the result of executing console commands")
|
||||||
|
end
|
||||||
|
|
||||||
function on_resume()
|
function on_resume()
|
||||||
redraw()
|
redraw()
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,17 +4,11 @@
|
|||||||
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
|
-- author = "Evgeny Zobnin (zobnin@gmail.com)"
|
||||||
-- version = "1.0"
|
-- version = "1.0"
|
||||||
|
|
||||||
ticks = -1
|
function on_tick(ticks)
|
||||||
|
|
||||||
function on_tick()
|
|
||||||
-- Update one time per 10 seconds
|
|
||||||
ticks = ticks + 1
|
|
||||||
if ticks % 10 ~= 0 then
|
if ticks % 10 ~= 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
ticks = 0
|
|
||||||
|
|
||||||
local info = system:system_info()
|
local info = system:system_info()
|
||||||
local strings = stringify_table(info)
|
local strings = stringify_table(info)
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,15 @@ local api_url = "https://api.uptimerobot.com/v2/"
|
|||||||
local click_url = "https://uptimerobot.com/dashboard#mainDashboard"
|
local click_url = "https://uptimerobot.com/dashboard#mainDashboard"
|
||||||
local media_type = "application/x-www-form-urlencoded"
|
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()
|
function on_alarm()
|
||||||
if (next(settings:get()) == nil) then
|
if (next(settings:get()) == nil) then
|
||||||
ui:show_text("Tap to enter API key")
|
ui:show_text("Tap to enter API key")
|
||||||
|
|||||||
Reference in New Issue
Block a user