Home Assistant v2.0.1 (#50)

* fix(*): Added a function to remove trailing slashes from URLs.

* feat(panel): Added a home assistant icon alongsite the panel tile.

* chore(plugin): Bump the version to 2.0.1

* fix(panel): Fixed wrong glyph syntax.
This commit is contained in:
Artur
2026-07-18 19:04:23 -04:00
committed by GitHub
parent 6b54e88389
commit 9d96040309
4 changed files with 34 additions and 14 deletions
+9 -3
View File
@@ -1,6 +1,6 @@
--!nonstrict
local haUrl = noctalia.getConfig("ha_url")
local haUrlRaw = noctalia.getConfig("ha_url")
local showEntityCount = noctalia.getConfig("show_entity_count")
local status = "unconfigured"
@@ -8,6 +8,11 @@ local entityCount = 0
local render
local function getCleanUrl()
if type(haUrlRaw) ~= "string" then return "" end
return (haUrlRaw:gsub("/$", ""))
end
local function tr(key, subst)
return noctalia.tr("widget." .. key, subst)
end
@@ -83,8 +88,9 @@ function onClick()
end
function onRightClick()
if haUrl and haUrl ~= "" then
noctalia.runAsync("xdg-open " .. ("'" .. haUrl:gsub("'", "'\\''") .. "'"))
local url = getCleanUrl()
if url and url ~= "" then
noctalia.runAsync("xdg-open " .. ("'" .. url:gsub("'", "'\\''") .. "'"))
end
end