monitors: Align nomenclature of the settings and rules
This commit is contained in:

committed by
Julian Bouzas

parent
335fe69461
commit
66c63a91a9
@@ -5,19 +5,10 @@
|
||||
--
|
||||
-- SPDX-License-Identifier: MIT
|
||||
|
||||
local cutils = require ("common-utils")
|
||||
|
||||
local config_settings = {}
|
||||
|
||||
-- apply properties from rules defined in JSON .conf file
|
||||
function rulesApplyProperties(properties)
|
||||
local matched, mprops = Settings.apply_rule ("libcamera_monitor", properties)
|
||||
|
||||
if (matched and mprops) then
|
||||
for k, v in pairs(mprops) do
|
||||
properties[k] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function findDuplicate(parent, id, property, value)
|
||||
for i = 0, id - 1, 1 do
|
||||
local obj = parent:get_managed_object(i)
|
||||
@@ -94,7 +85,7 @@ function createNode(parent, id, type, factory, properties)
|
||||
end
|
||||
|
||||
-- apply properties from rules defined in JSON .conf file
|
||||
rulesApplyProperties(properties)
|
||||
cutils.evaluateRulesApplyProperties (properties, "monitor.libcamera")
|
||||
if properties ["node.disabled"] then
|
||||
return
|
||||
end
|
||||
@@ -131,10 +122,11 @@ function createDevice(parent, id, type, factory, properties)
|
||||
or "Unknown device"
|
||||
|
||||
-- apply properties from rules defined in JSON .conf file
|
||||
rulesApplyProperties(properties)
|
||||
cutils.evaluateRulesApplyProperties (properties, "monitor.libcamera")
|
||||
if properties ["device.disabled"] then
|
||||
return
|
||||
end
|
||||
|
||||
-- create the device
|
||||
local device = SpaDevice(factory, properties)
|
||||
if device then
|
||||
|
Reference in New Issue
Block a user