loupedeck-commander 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import { readConfigFile as readConfigFile, writeJSONFile,syncParams, writeYAMLFi
3
3
  export class ApplicationConfig {
4
4
  application = 'undefined'
5
5
  profiles = []
6
+ parameters = {}
6
7
  initialized = false
7
8
 
8
9
  loadFromFile (fileName) {
@@ -19,8 +20,12 @@ export class ApplicationConfig {
19
20
  }
20
21
  else{
21
22
  this.application = config.application
23
+ this.parameters = new ParametersConfig()
24
+
25
+
22
26
  for (let i = 0; i < config.profiles.length; i++) {
23
27
  const profile = new Profile(config.profiles[i],config.profiles.length,i)
28
+ profile.setParams(config.parameters)
24
29
  if (profile.loaded){
25
30
  this.profiles.push(profile)
26
31
  }else{
@@ -104,6 +109,20 @@ class Profile {
104
109
  return this.loaded
105
110
  }
106
111
 
112
+ setParams(parameters){
113
+ if (parameters === undefined)
114
+ return
115
+
116
+ let keys = Object.keys(parameters)
117
+ for (var i=0;i<keys.length;i++){
118
+ let key = keys[i]
119
+ if (!(key in this.parameters)){
120
+ this.parameters[key] = parameters[key]
121
+ }
122
+ }
123
+
124
+ }
125
+
107
126
  saveToFile (fileName) {
108
127
  fileName = fileName.toLowerCase()
109
128
 
package/config.yaml CHANGED
@@ -1,4 +1,6 @@
1
1
  application: Example
2
+ parameters:
3
+ verbose: true
2
4
  profiles:
3
5
  - name: profile-1
4
6
  file: profile-1.yaml
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "loupedeck-commander",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "A system to ease working with LoupeDeck devices using CMD-line, OPC/UA or HTTP-client interfaces",
5
5
  "main": "index.mjs",
6
6
  "scripts": {
package/profile-1.yaml CHANGED
@@ -1,5 +1,7 @@
1
1
  name: profile-1
2
2
  profile: example
3
+ parameters:
4
+ verbose: false
3
5
  description: ""
4
6
  touch:
5
7
  center:
package/profile-2.yaml CHANGED
@@ -1,5 +1,7 @@
1
1
  name: profile-1
2
2
  profile: example
3
+ parameters:
4
+ verbose: true
3
5
  description: ""
4
6
  touch:
5
7
  center: