[shelly](fix): support shelly v3 (#182)

* updates for shelly v3

* new major for shelly v3

* fix: default option value
This commit is contained in:
Josh Slate
2026-07-31 17:18:32 -04:00
committed by GitHub
parent 125086f8f5
commit 083230d7f9
5 changed files with 78 additions and 22 deletions
+9 -2
View File
@@ -18,7 +18,7 @@ noctalia.setUpdateInterval(updateInterval)
function refresh()
isPolling = true
noctalia.runAsync("shelly check-updates --json", function(result)
noctalia.runAsync("shelly list-updates all --json", function(result)
isPolling = false
if result.exitCode ~= 0 then
@@ -28,7 +28,14 @@ function refresh()
return
end
local decoded = noctalia.json.decode(result.stdout)
local stdout = result.stdout
-- Shelly's JSON output may leak stderr into stdout. Remove stderr value to ensure valid JSON.
if result.stderr ~= "" then
stdout = stdout:gsub(result.stderr, "")
end
local decoded = noctalia.json.decode(stdout)
if type(decoded) ~= "table" then
updateError = noctalia.tr("bar.tooltip.error.decode_json")
noctalia.state.set("update_error", updateError)