mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2025-12-20 06:30:04 +01:00
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:
parent
15d98f59e5
commit
5071a85997
4 changed files with 5 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue