src/scripts: add few comments
This commit is contained in:
@@ -4,8 +4,12 @@
|
|||||||
--
|
--
|
||||||
-- SPDX-License-Identifier: MIT
|
-- SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
-- hook to make sure the user prefered device(default.configured.*) is higher
|
-- hook to make sure the user prefered device(default.configured.*) in other
|
||||||
-- priority.
|
-- words currently selected device is given higher priority
|
||||||
|
|
||||||
|
-- state-default-nodes.lua also does find out the default node out of the user
|
||||||
|
-- preferences(current and past), however it doesnt give any higher priority to
|
||||||
|
-- the currently selected device.
|
||||||
|
|
||||||
log = Log.open_topic ("s-default-nodes")
|
log = Log.open_topic ("s-default-nodes")
|
||||||
|
|
||||||
|
@@ -4,8 +4,13 @@
|
|||||||
--
|
--
|
||||||
-- SPDX-License-Identifier: MIT
|
-- SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
-- looks for changes in user-preferences and devices added/removed and schedules
|
||||||
|
-- rescan and pushes "select-default-node" event for each of the media_classes
|
||||||
|
|
||||||
log = Log.open_topic ("s-default-nodes")
|
log = Log.open_topic ("s-default-nodes")
|
||||||
|
|
||||||
|
-- looks for changes in user-preferences and devices added/removed and schedules
|
||||||
|
-- rescan
|
||||||
SimpleEventHook {
|
SimpleEventHook {
|
||||||
name = "default-nodes/rescan-trigger",
|
name = "default-nodes/rescan-trigger",
|
||||||
interests = {
|
interests = {
|
||||||
@@ -33,6 +38,7 @@ SimpleEventHook {
|
|||||||
end
|
end
|
||||||
}:register ()
|
}:register ()
|
||||||
|
|
||||||
|
-- pushes "select-default-node" event for each of the media_classes
|
||||||
SimpleEventHook {
|
SimpleEventHook {
|
||||||
name = "default-nodes/rescan",
|
name = "default-nodes/rescan",
|
||||||
interests = {
|
interests = {
|
||||||
|
@@ -4,6 +4,12 @@
|
|||||||
--
|
--
|
||||||
-- SPDX-License-Identifier: MIT
|
-- SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
-- the script states the default nodes from the user preferences, it has hooks
|
||||||
|
-- which stores the user preferences(it stores not just the current preference
|
||||||
|
-- but all the previous preferences) in to the state file, retrives them from
|
||||||
|
-- state file during the bootup, finally it has a hook which finds a default
|
||||||
|
-- node out of the user preferences
|
||||||
|
|
||||||
cutils = require ("common-utils")
|
cutils = require ("common-utils")
|
||||||
config = require ("device-config")
|
config = require ("device-config")
|
||||||
log = Log.open_topic ("s-default-nodes")
|
log = Log.open_topic ("s-default-nodes")
|
||||||
|
@@ -4,6 +4,8 @@
|
|||||||
--
|
--
|
||||||
-- SPDX-License-Identifier: MIT
|
-- SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
-- apply the selected profile to the device
|
||||||
|
|
||||||
cutils = require ("common-utils")
|
cutils = require ("common-utils")
|
||||||
log = Log.open_topic ("s-device")
|
log = Log.open_topic ("s-device")
|
||||||
|
|
||||||
|
@@ -4,6 +4,8 @@
|
|||||||
--
|
--
|
||||||
-- SPDX-License-Identifier: MIT
|
-- SPDX-License-Identifier: MIT
|
||||||
|
|
||||||
|
-- look for new devices and raise select-profile event.
|
||||||
|
|
||||||
cutils = require ("common-utils")
|
cutils = require ("common-utils")
|
||||||
log = Log.open_topic ("s-device")
|
log = Log.open_topic ("s-device")
|
||||||
|
|
||||||
|
@@ -8,9 +8,9 @@
|
|||||||
--
|
--
|
||||||
-- SPDX-License-Identifier: MIT
|
-- SPDX-License-Identifier: MIT
|
||||||
--
|
--
|
||||||
-- Update the device info cache with the latest information from EnumRoute
|
-- Update the device info cache with the latest information from EnumRoute(all
|
||||||
-- and trigger a "select-routes" event to select new routes for the
|
-- the device routes) and trigger a "select-routes" event to select new routes
|
||||||
-- given device configuration, if it has changed
|
-- for the given device configuration, if it has changed
|
||||||
|
|
||||||
cutils = require ("common-utils")
|
cutils = require ("common-utils")
|
||||||
config = require ("device-config")
|
config = require ("device-config")
|
||||||
|
@@ -7,6 +7,10 @@
|
|||||||
-- This file contains all the logic related to saving device profiles
|
-- This file contains all the logic related to saving device profiles
|
||||||
-- to a state file and restoring them later on.
|
-- to a state file and restoring them later on.
|
||||||
|
|
||||||
|
-- A devices profile needs to be selected for any new device. the script selects
|
||||||
|
-- the device profile from the user preferences, as well as store the user
|
||||||
|
-- selected device profile to state file
|
||||||
|
|
||||||
cutils = require ("common-utils")
|
cutils = require ("common-utils")
|
||||||
config = require ("device-config")
|
config = require ("device-config")
|
||||||
log = Log.open_topic ("s-device")
|
log = Log.open_topic ("s-device")
|
||||||
|
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
-- Receive script arguments from config.lua
|
-- Receive script arguments from config.lua
|
||||||
|
|
||||||
|
-- creates the virtual items defined in the JSON(virtual.conf)
|
||||||
|
|
||||||
log = Log.open_topic ("s-node")
|
log = Log.open_topic ("s-node")
|
||||||
|
|
||||||
local defaults = {}
|
local defaults = {}
|
||||||
|
Reference in New Issue
Block a user