scripts: Fix compatibility issues with new Lua Properties API

We need to explicitly use Properties() in those cases as {} construct tables.
This commit is contained in:
Julian Bouzas 2025-10-29 11:14:29 -04:00 committed by George Kiagiadakis
parent 15d98f59e5
commit 5071a85997
4 changed files with 5 additions and 5 deletions

View file

@ -49,7 +49,7 @@ function handlePersistentSetting (enable)
-- the state storage
state = Settings.get_boolean ("bluetooth.autoswitch-to-headset-profile")
and State ("bluetooth-autoswitch") or nil
headset_profiles = state and state:load () or {}
headset_profiles = state and state:load () or Properties()
else
state = nil
headset_profiles = nil

View file

@ -27,7 +27,7 @@ SimpleEventHook {
local device = event:get_subject ()
local event_properties = event:get_properties ()
local active_ids = event_properties ["profile.active-device-ids"]
local selected_routes = event:get_data ("selected-routes") or {}
local selected_routes = event:get_data ("selected-routes") or Properties()
local dev_info = devinfo:get_device_info (device)
assert (dev_info)

View file

@ -36,7 +36,7 @@ find_stored_routes_hook = SimpleEventHook {
local event_properties = event:get_properties ()
local profile_name = event_properties ["profile.name"]
local active_ids = event_properties ["profile.active-device-ids"]
local selected_routes = event:get_data ("selected-routes") or {}
local selected_routes = event:get_data ("selected-routes") or Properties()
local dev_info = devinfo:get_device_info (device)
assert (dev_info)
@ -108,7 +108,7 @@ apply_route_props_hook = SimpleEventHook {
},
execute = function (event)
local device = event:get_subject ()
local selected_routes = event:get_data ("selected-routes") or {}
local selected_routes = event:get_data ("selected-routes") or Properties()
local new_selected_routes = {}
local dev_info = devinfo:get_device_info (device)

View file

@ -78,7 +78,7 @@ end
function createMonitor()
local monitor_props = {}
for k, v in pairs(config.properties or {}) do
for k, v in pairs(config.properties or Properties()) do
monitor_props[k] = v
end