@zwave-js/config 14.0.0-beta.1 → 14.0.0-beta.4

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.
Files changed (214) hide show
  1. package/build/{ConfigManager.d.ts → cjs/ConfigManager.d.ts} +2 -2
  2. package/build/cjs/ConfigManager.js +208 -0
  3. package/build/cjs/ConfigManager.js.map +7 -0
  4. package/build/cjs/JsonTemplate.js +198 -0
  5. package/build/cjs/JsonTemplate.js.map +7 -0
  6. package/build/{Logger.d.ts → cjs/Logger.d.ts} +1 -1
  7. package/build/cjs/Logger.js +50 -0
  8. package/build/cjs/Logger.js.map +7 -0
  9. package/build/cjs/Logger_safe.js +32 -0
  10. package/build/cjs/Logger_safe.js.map +7 -0
  11. package/build/cjs/Logic.js +71 -0
  12. package/build/cjs/Logic.js.map +7 -0
  13. package/build/cjs/LogicParser.js +1343 -0
  14. package/build/cjs/LogicParser.js.map +7 -0
  15. package/build/cjs/Manufacturers.js +88 -0
  16. package/build/cjs/Manufacturers.js.map +7 -0
  17. package/build/cjs/_version.d.ts +2 -0
  18. package/build/cjs/_version.js +29 -0
  19. package/build/cjs/_version.js.map +7 -0
  20. package/build/{devices → cjs/devices}/AssociationConfig.d.ts +2 -2
  21. package/build/cjs/devices/AssociationConfig.js +93 -0
  22. package/build/cjs/devices/AssociationConfig.js.map +7 -0
  23. package/build/{devices → cjs/devices}/CompatConfig.d.ts +2 -2
  24. package/build/cjs/devices/CompatConfig.js +584 -0
  25. package/build/cjs/devices/CompatConfig.js.map +7 -0
  26. package/build/{devices → cjs/devices}/ConditionalItem.d.ts +1 -1
  27. package/build/cjs/devices/ConditionalItem.js +107 -0
  28. package/build/cjs/devices/ConditionalItem.js.map +7 -0
  29. package/build/{devices → cjs/devices}/ConditionalPrimitive.d.ts +2 -2
  30. package/build/cjs/devices/ConditionalPrimitive.js +59 -0
  31. package/build/cjs/devices/ConditionalPrimitive.js.map +7 -0
  32. package/build/{devices → cjs/devices}/DeviceConfig.d.ts +7 -7
  33. package/build/cjs/devices/DeviceConfig.js +502 -0
  34. package/build/cjs/devices/DeviceConfig.js.map +7 -0
  35. package/build/cjs/devices/DeviceConfig.unit._test.js +17 -0
  36. package/build/cjs/devices/DeviceConfig.unit._test.js.map +7 -0
  37. package/build/{devices → cjs/devices}/DeviceMetadata.d.ts +3 -3
  38. package/build/cjs/devices/DeviceMetadata.js +112 -0
  39. package/build/cjs/devices/DeviceMetadata.js.map +7 -0
  40. package/build/{devices → cjs/devices}/EndpointConfig.d.ts +5 -5
  41. package/build/cjs/devices/EndpointConfig.js +87 -0
  42. package/build/cjs/devices/EndpointConfig.js.map +7 -0
  43. package/build/{devices → cjs/devices}/ParamInformation.d.ts +3 -3
  44. package/build/cjs/devices/ParamInformation.js +209 -0
  45. package/build/cjs/devices/ParamInformation.js.map +7 -0
  46. package/build/cjs/devices/shared.js +17 -0
  47. package/build/cjs/devices/shared.js.map +7 -0
  48. package/build/cjs/index.d.ts +13 -0
  49. package/build/cjs/index.js +53 -0
  50. package/build/cjs/index.js.map +7 -0
  51. package/build/cjs/index_safe.d.ts +3 -0
  52. package/build/cjs/index_safe.js +32 -0
  53. package/build/cjs/index_safe.js.map +7 -0
  54. package/build/cjs/package.json +3 -0
  55. package/build/{utils.d.ts → cjs/utils.d.ts} +2 -2
  56. package/build/cjs/utils.js +117 -0
  57. package/build/cjs/utils.js.map +7 -0
  58. package/build/cjs/utils_safe.js +57 -0
  59. package/build/cjs/utils_safe.js.map +7 -0
  60. package/build/esm/ConfigManager.d.ts +57 -0
  61. package/build/esm/ConfigManager.d.ts.map +1 -0
  62. package/build/{ConfigManager.js → esm/ConfigManager.js} +36 -43
  63. package/build/esm/ConfigManager.js.map +1 -0
  64. package/build/esm/JsonTemplate.d.ts +4 -0
  65. package/build/esm/JsonTemplate.d.ts.map +1 -0
  66. package/build/{JsonTemplate.js → esm/JsonTemplate.js} +30 -60
  67. package/build/esm/JsonTemplate.js.map +1 -0
  68. package/build/esm/Logger.d.ts +11 -0
  69. package/build/esm/Logger.d.ts.map +1 -0
  70. package/build/esm/Logger.js +23 -0
  71. package/build/esm/Logger.js.map +1 -0
  72. package/build/esm/Logger_safe.d.ts +5 -0
  73. package/build/esm/Logger_safe.d.ts.map +1 -0
  74. package/build/esm/Logger_safe.js +3 -0
  75. package/build/esm/Logger_safe.js.map +1 -0
  76. package/build/esm/Logic.d.ts +4 -0
  77. package/build/esm/Logic.d.ts.map +1 -0
  78. package/build/esm/Logic.js +35 -0
  79. package/build/esm/Logic.js.map +1 -0
  80. package/build/esm/LogicParser.d.ts +93 -0
  81. package/build/esm/LogicParser.d.ts.map +1 -0
  82. package/build/{LogicParser.js → esm/LogicParser.js} +2 -5
  83. package/build/{LogicParser.js.map → esm/LogicParser.js.map} +1 -1
  84. package/build/esm/Manufacturers.d.ts +6 -0
  85. package/build/esm/Manufacturers.d.ts.map +1 -0
  86. package/build/esm/Manufacturers.js +55 -0
  87. package/build/esm/Manufacturers.js.map +1 -0
  88. package/build/esm/_version.d.ts +2 -0
  89. package/build/esm/_version.d.ts.map +1 -0
  90. package/build/esm/_version.js +3 -0
  91. package/build/esm/_version.js.map +1 -0
  92. package/build/esm/devices/AssociationConfig.d.ts +27 -0
  93. package/build/esm/devices/AssociationConfig.d.ts.map +1 -0
  94. package/build/{devices → esm/devices}/AssociationConfig.js +12 -16
  95. package/build/esm/devices/AssociationConfig.js.map +1 -0
  96. package/build/esm/devices/CompatConfig.d.ts +112 -0
  97. package/build/esm/devices/CompatConfig.d.ts.map +1 -0
  98. package/build/{devices → esm/devices}/CompatConfig.js +112 -119
  99. package/build/esm/devices/CompatConfig.js.map +1 -0
  100. package/build/esm/devices/ConditionalItem.d.ts +14 -0
  101. package/build/esm/devices/ConditionalItem.d.ts.map +1 -0
  102. package/build/{devices → esm/devices}/ConditionalItem.js +15 -21
  103. package/build/esm/devices/ConditionalItem.js.map +1 -0
  104. package/build/esm/devices/ConditionalPrimitive.d.ts +13 -0
  105. package/build/esm/devices/ConditionalPrimitive.d.ts.map +1 -0
  106. package/build/esm/devices/ConditionalPrimitive.js +35 -0
  107. package/build/esm/devices/ConditionalPrimitive.js.map +1 -0
  108. package/build/esm/devices/DeviceConfig.d.ts +117 -0
  109. package/build/esm/devices/DeviceConfig.d.ts.map +1 -0
  110. package/build/{devices → esm/devices}/DeviceConfig.js +96 -108
  111. package/build/esm/devices/DeviceConfig.js.map +1 -0
  112. package/build/esm/devices/DeviceConfig.unit._test.d.ts +2 -0
  113. package/build/esm/devices/DeviceConfig.unit._test.d.ts.map +1 -0
  114. package/build/{devices → esm/devices}/DeviceConfig.unit._test.js +1 -2
  115. package/build/esm/devices/DeviceConfig.unit._test.js.map +1 -0
  116. package/build/esm/devices/DeviceMetadata.d.ts +41 -0
  117. package/build/esm/devices/DeviceMetadata.d.ts.map +1 -0
  118. package/build/{devices → esm/devices}/DeviceMetadata.js +16 -21
  119. package/build/esm/devices/DeviceMetadata.js.map +1 -0
  120. package/build/esm/devices/EndpointConfig.d.ts +20 -0
  121. package/build/esm/devices/EndpointConfig.d.ts.map +1 -0
  122. package/build/esm/devices/EndpointConfig.js +60 -0
  123. package/build/esm/devices/EndpointConfig.js.map +1 -0
  124. package/build/esm/devices/ParamInformation.d.ts +50 -0
  125. package/build/esm/devices/ParamInformation.d.ts.map +1 -0
  126. package/build/{devices → esm/devices}/ParamInformation.js +38 -44
  127. package/build/esm/devices/ParamInformation.js.map +1 -0
  128. package/build/esm/devices/shared.d.ts +11 -0
  129. package/build/esm/devices/shared.d.ts.map +1 -0
  130. package/build/esm/devices/shared.js +2 -0
  131. package/build/{devices → esm/devices}/shared.js.map +1 -1
  132. package/build/esm/index.d.ts +13 -0
  133. package/build/esm/index.d.ts.map +1 -0
  134. package/build/esm/index.js +14 -0
  135. package/build/esm/index.js.map +1 -0
  136. package/build/esm/index_safe.d.ts +3 -0
  137. package/build/esm/index_safe.d.ts.map +1 -0
  138. package/build/esm/index_safe.js +4 -0
  139. package/build/esm/index_safe.js.map +1 -0
  140. package/build/esm/package.json +3 -0
  141. package/build/esm/utils.d.ts +19 -0
  142. package/build/esm/utils.d.ts.map +1 -0
  143. package/build/esm/utils.js +93 -0
  144. package/build/esm/utils.js.map +1 -0
  145. package/build/esm/utils_safe.d.ts +7 -0
  146. package/build/esm/utils_safe.d.ts.map +1 -0
  147. package/build/esm/utils_safe.js +28 -0
  148. package/build/esm/utils_safe.js.map +1 -0
  149. package/package.json +22 -19
  150. package/build/ConfigManager.d.ts.map +0 -1
  151. package/build/ConfigManager.js.map +0 -1
  152. package/build/JsonTemplate.d.ts.map +0 -1
  153. package/build/JsonTemplate.js.map +0 -1
  154. package/build/Logger.d.ts.map +0 -1
  155. package/build/Logger.js +0 -27
  156. package/build/Logger.js.map +0 -1
  157. package/build/Logger_safe.d.ts.map +0 -1
  158. package/build/Logger_safe.js +0 -6
  159. package/build/Logger_safe.js.map +0 -1
  160. package/build/Logic.d.ts.map +0 -1
  161. package/build/Logic.js +0 -60
  162. package/build/Logic.js.map +0 -1
  163. package/build/LogicParser.d.ts.map +0 -1
  164. package/build/Manufacturers.d.ts.map +0 -1
  165. package/build/Manufacturers.js +0 -62
  166. package/build/Manufacturers.js.map +0 -1
  167. package/build/_version.d.ts +0 -2
  168. package/build/_version.d.ts.map +0 -1
  169. package/build/_version.js +0 -6
  170. package/build/_version.js.map +0 -1
  171. package/build/devices/AssociationConfig.d.ts.map +0 -1
  172. package/build/devices/AssociationConfig.js.map +0 -1
  173. package/build/devices/CompatConfig.d.ts.map +0 -1
  174. package/build/devices/CompatConfig.js.map +0 -1
  175. package/build/devices/ConditionalItem.d.ts.map +0 -1
  176. package/build/devices/ConditionalItem.js.map +0 -1
  177. package/build/devices/ConditionalPrimitive.d.ts.map +0 -1
  178. package/build/devices/ConditionalPrimitive.js +0 -40
  179. package/build/devices/ConditionalPrimitive.js.map +0 -1
  180. package/build/devices/DeviceConfig.d.ts.map +0 -1
  181. package/build/devices/DeviceConfig.js.map +0 -1
  182. package/build/devices/DeviceConfig.unit._test.d.ts.map +0 -1
  183. package/build/devices/DeviceConfig.unit._test.js.map +0 -1
  184. package/build/devices/DeviceMetadata.d.ts.map +0 -1
  185. package/build/devices/DeviceMetadata.js.map +0 -1
  186. package/build/devices/EndpointConfig.d.ts.map +0 -1
  187. package/build/devices/EndpointConfig.js +0 -64
  188. package/build/devices/EndpointConfig.js.map +0 -1
  189. package/build/devices/ParamInformation.d.ts.map +0 -1
  190. package/build/devices/ParamInformation.js.map +0 -1
  191. package/build/devices/shared.d.ts.map +0 -1
  192. package/build/devices/shared.js +0 -3
  193. package/build/index.d.ts +0 -13
  194. package/build/index.d.ts.map +0 -1
  195. package/build/index.js +0 -33
  196. package/build/index.js.map +0 -1
  197. package/build/index_safe.d.ts +0 -3
  198. package/build/index_safe.d.ts.map +0 -1
  199. package/build/index_safe.js +0 -22
  200. package/build/index_safe.js.map +0 -1
  201. package/build/utils.d.ts.map +0 -1
  202. package/build/utils.js +0 -124
  203. package/build/utils.js.map +0 -1
  204. package/build/utils_safe.d.ts.map +0 -1
  205. package/build/utils_safe.js +0 -33
  206. package/build/utils_safe.js.map +0 -1
  207. /package/build/{JsonTemplate.d.ts → cjs/JsonTemplate.d.ts} +0 -0
  208. /package/build/{Logger_safe.d.ts → cjs/Logger_safe.d.ts} +0 -0
  209. /package/build/{Logic.d.ts → cjs/Logic.d.ts} +0 -0
  210. /package/build/{LogicParser.d.ts → cjs/LogicParser.d.ts} +0 -0
  211. /package/build/{Manufacturers.d.ts → cjs/Manufacturers.d.ts} +0 -0
  212. /package/build/{devices → cjs/devices}/DeviceConfig.unit._test.d.ts +0 -0
  213. /package/build/{devices → cjs/devices}/shared.d.ts +0 -0
  214. /package/build/{utils_safe.d.ts → cjs/utils_safe.d.ts} +0 -0
@@ -1,18 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CompatOverrideQueries = exports.CompatMapAlarm = exports.CompatAddCC = exports.ConditionalCompatConfig = void 0;
4
- const safe_1 = require("@zwave-js/core/safe");
5
- const safe_2 = require("@zwave-js/shared/safe");
6
- const typeguards_1 = require("alcalzone-shared/typeguards");
7
- const utils_safe_1 = require("../utils_safe");
8
- const ConditionalItem_1 = require("./ConditionalItem");
9
- class ConditionalCompatConfig {
1
+ import { getCCName, stripUndefined, } from "@zwave-js/core/safe";
2
+ import { pick } from "@zwave-js/shared/safe";
3
+ import { isArray, isObject } from "alcalzone-shared/typeguards/index.js";
4
+ import { throwInvalidConfig, tryParseCCId } from "../utils_safe.js";
5
+ import { conditionApplies } from "./ConditionalItem.js";
6
+ export class ConditionalCompatConfig {
10
7
  valueIdRegex = /^\$value\$\[.+\]$/;
11
8
  constructor(filename, definition) {
12
9
  this.condition = definition.$if;
13
10
  if (definition.queryOnWakeup != undefined) {
14
- if (!(0, typeguards_1.isArray)(definition.queryOnWakeup)
15
- || !definition.queryOnWakeup.every((cmd) => (0, typeguards_1.isArray)(cmd)
11
+ if (!isArray(definition.queryOnWakeup)
12
+ || !definition.queryOnWakeup.every((cmd) => isArray(cmd)
16
13
  && cmd.length >= 2
17
14
  && typeof cmd[0] === "string"
18
15
  && typeof cmd[1] === "string"
@@ -21,7 +18,7 @@ class ConditionalCompatConfig {
21
18
  .every((arg) => typeof arg === "string"
22
19
  || typeof arg === "number"
23
20
  || typeof arg === "boolean"))) {
24
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
21
+ throwInvalidConfig("devices", `config/devices/${filename}:
25
22
  error in compat option queryOnWakeup`);
26
23
  }
27
24
  // Parse "smart" values into partial Value IDs
@@ -39,15 +36,15 @@ error in compat option queryOnWakeup`);
39
36
  }
40
37
  if (definition.disableAutoRefresh != undefined) {
41
38
  if (definition.disableAutoRefresh !== true) {
42
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
39
+ throwInvalidConfig("devices", `config/devices/${filename}:
43
40
  compat option disableAutoRefresh must be true or omitted`);
44
41
  }
45
42
  this.disableAutoRefresh = definition.disableAutoRefresh;
46
43
  }
47
44
  if (definition.disableCallbackFunctionTypeCheck != undefined) {
48
- if (!(0, typeguards_1.isArray)(definition.disableCallbackFunctionTypeCheck)
45
+ if (!isArray(definition.disableCallbackFunctionTypeCheck)
49
46
  || !definition.disableCallbackFunctionTypeCheck.every((d) => typeof d === "number" && d % 1 === 0 && d > 0)) {
50
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
47
+ throwInvalidConfig("devices", `config/devices/${filename}:
51
48
  when present, compat option disableCallbackFunctionTypeCheck msut be an array of positive integers`);
52
49
  }
53
50
  this.disableCallbackFunctionTypeCheck =
@@ -55,7 +52,7 @@ when present, compat option disableCallbackFunctionTypeCheck msut be an array of
55
52
  }
56
53
  if (definition.disableStrictEntryControlDataValidation != undefined) {
57
54
  if (definition.disableStrictEntryControlDataValidation !== true) {
58
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
55
+ throwInvalidConfig("devices", `config/devices/${filename}:
59
56
  compat option disableStrictEntryControlDataValidation must be true or omitted`);
60
57
  }
61
58
  this.disableStrictEntryControlDataValidation =
@@ -63,7 +60,7 @@ compat option disableStrictEntryControlDataValidation must be true or omitted`);
63
60
  }
64
61
  if (definition.disableStrictMeasurementValidation != undefined) {
65
62
  if (definition.disableStrictMeasurementValidation !== true) {
66
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
63
+ throwInvalidConfig("devices", `config/devices/${filename}:
67
64
  compat option disableStrictMeasurementValidation must be true or omitted`);
68
65
  }
69
66
  this.disableStrictMeasurementValidation =
@@ -71,7 +68,7 @@ compat option disableStrictMeasurementValidation must be true or omitted`);
71
68
  }
72
69
  if (definition.encodeCCsUsingTargetVersion != undefined) {
73
70
  if (definition.encodeCCsUsingTargetVersion !== true) {
74
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
71
+ throwInvalidConfig("devices", `config/devices/${filename}:
75
72
  compat option encodeCCsUsingTargetVersion must be true or omitted`);
76
73
  }
77
74
  this.encodeCCsUsingTargetVersion =
@@ -79,7 +76,7 @@ compat option encodeCCsUsingTargetVersion must be true or omitted`);
79
76
  }
80
77
  if (definition.forceNotificationIdleReset != undefined) {
81
78
  if (definition.forceNotificationIdleReset !== true) {
82
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
79
+ throwInvalidConfig("devices", `config/devices/${filename}:
83
80
  compat option forceNotificationIdleReset must be true or omitted`);
84
81
  }
85
82
  this.forceNotificationIdleReset =
@@ -87,12 +84,12 @@ compat option forceNotificationIdleReset must be true or omitted`);
87
84
  }
88
85
  if (definition.forceSceneControllerGroupCount != undefined) {
89
86
  if (typeof definition.forceSceneControllerGroupCount !== "number") {
90
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
87
+ throwInvalidConfig("devices", `config/devices/${filename}:
91
88
  compat option forceSceneControllerGroupCount must be a number!`);
92
89
  }
93
90
  if (definition.forceSceneControllerGroupCount < 0
94
91
  || definition.forceSceneControllerGroupCount > 255) {
95
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
92
+ throwInvalidConfig("devices", `config/devices/${filename}:
96
93
  compat option forceSceneControllerGroupCount must be between 0 and 255!`);
97
94
  }
98
95
  this.forceSceneControllerGroupCount =
@@ -100,21 +97,21 @@ compat option forceSceneControllerGroupCount must be between 0 and 255!`);
100
97
  }
101
98
  if (definition.mapBasicReport != undefined) {
102
99
  if (!isBasicReportMapping(definition.mapBasicReport)) {
103
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
100
+ throwInvalidConfig("devices", `config/devices/${filename}:
104
101
  compat option mapBasicReport contains an invalid value`);
105
102
  }
106
103
  this.mapBasicReport = definition.mapBasicReport;
107
104
  }
108
105
  if (definition.mapBasicSet != undefined) {
109
106
  if (!isBasicSetMapping(definition.mapBasicSet)) {
110
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
107
+ throwInvalidConfig("devices", `config/devices/${filename}:
111
108
  compat option mapBasicSet contains an invalid value`);
112
109
  }
113
110
  this.mapBasicSet = definition.mapBasicSet;
114
111
  }
115
112
  if (definition.preserveRootApplicationCCValueIDs != undefined) {
116
113
  if (definition.preserveRootApplicationCCValueIDs !== true) {
117
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
114
+ throwInvalidConfig("devices", `config/devices/${filename}:
118
115
  error in compat option preserveRootApplicationCCValueIDs`);
119
116
  }
120
117
  this.preserveRootApplicationCCValueIDs =
@@ -122,25 +119,25 @@ error in compat option preserveRootApplicationCCValueIDs`);
122
119
  }
123
120
  if (definition.preserveEndpoints != undefined) {
124
121
  if (definition.preserveEndpoints !== "*"
125
- && !((0, typeguards_1.isArray)(definition.preserveEndpoints)
122
+ && !(isArray(definition.preserveEndpoints)
126
123
  && definition.preserveEndpoints.every((d) => typeof d === "number" && d % 1 === 0 && d > 0))) {
127
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
124
+ throwInvalidConfig("devices", `config/devices/${filename}:
128
125
  compat option preserveEndpoints must be "*" or an array of positive integers`);
129
126
  }
130
127
  this.preserveEndpoints = definition.preserveEndpoints;
131
128
  }
132
129
  if (definition.removeEndpoints != undefined) {
133
130
  if (definition.removeEndpoints !== "*"
134
- && !((0, typeguards_1.isArray)(definition.removeEndpoints)
131
+ && !(isArray(definition.removeEndpoints)
135
132
  && definition.removeEndpoints.every((d) => typeof d === "number" && d % 1 === 0 && d > 0))) {
136
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
133
+ throwInvalidConfig("devices", `config/devices/${filename}:
137
134
  compat option removeEndpoints must be "*" or an array of positive integers`);
138
135
  }
139
136
  this.removeEndpoints = definition.removeEndpoints;
140
137
  }
141
138
  if (definition.skipConfigurationNameQuery != undefined) {
142
139
  if (definition.skipConfigurationNameQuery !== true) {
143
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
140
+ throwInvalidConfig("devices", `config/devices/${filename}:
144
141
  error in compat option skipConfigurationNameQuery`);
145
142
  }
146
143
  this.skipConfigurationNameQuery =
@@ -148,7 +145,7 @@ error in compat option skipConfigurationNameQuery`);
148
145
  }
149
146
  if (definition.skipConfigurationInfoQuery != undefined) {
150
147
  if (definition.skipConfigurationInfoQuery !== true) {
151
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
148
+ throwInvalidConfig("devices", `config/devices/${filename}:
152
149
  error in compat option skipConfigurationInfoQuery`);
153
150
  }
154
151
  this.skipConfigurationInfoQuery =
@@ -156,23 +153,23 @@ error in compat option skipConfigurationInfoQuery`);
156
153
  }
157
154
  if (definition.treatMultilevelSwitchSetAsEvent != undefined) {
158
155
  if (definition.treatMultilevelSwitchSetAsEvent !== true) {
159
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
156
+ throwInvalidConfig("devices", `config/devices/${filename}:
160
157
  error in compat option treatMultilevelSwitchSetAsEvent`);
161
158
  }
162
159
  this.treatMultilevelSwitchSetAsEvent =
163
160
  definition.treatMultilevelSwitchSetAsEvent;
164
161
  }
165
162
  if (definition.treatSetAsReport != undefined) {
166
- if (!((0, typeguards_1.isArray)(definition.treatSetAsReport)
163
+ if (!(isArray(definition.treatSetAsReport)
167
164
  && definition.treatSetAsReport.every((d) => typeof d === "string"))) {
168
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
165
+ throwInvalidConfig("devices", `config/devices/${filename}:
169
166
  compat option treatSetAsReport must be an array of strings`);
170
167
  }
171
168
  this.treatSetAsReport = new Set(definition.treatSetAsReport);
172
169
  }
173
170
  if (definition.treatDestinationEndpointAsSource != undefined) {
174
171
  if (definition.treatDestinationEndpointAsSource !== true) {
175
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
172
+ throwInvalidConfig("devices", `config/devices/${filename}:
176
173
  error in compat option treatDestinationEndpointAsSource`);
177
174
  }
178
175
  this.treatDestinationEndpointAsSource =
@@ -180,19 +177,19 @@ error in compat option treatDestinationEndpointAsSource`);
180
177
  }
181
178
  if (definition.useUTCInTimeParametersCC != undefined) {
182
179
  if (definition.useUTCInTimeParametersCC !== true) {
183
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
180
+ throwInvalidConfig("devices", `config/devices/${filename}:
184
181
  compat option useUTCInTimeParametersCC must be true or omitted`);
185
182
  }
186
183
  this.useUTCInTimeParametersCC = definition.useUTCInTimeParametersCC;
187
184
  }
188
185
  if (definition.manualValueRefreshDelayMs != undefined) {
189
186
  if (typeof definition.manualValueRefreshDelayMs !== "number") {
190
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
187
+ throwInvalidConfig("devices", `config/devices/${filename}:
191
188
  compat option manualValueRefreshDelayMs must be a number!`);
192
189
  }
193
190
  if (definition.manualValueRefreshDelayMs % 1 !== 0
194
191
  || definition.manualValueRefreshDelayMs < 0) {
195
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
192
+ throwInvalidConfig("devices", `config/devices/${filename}:
196
193
  compat option manualValueRefreshDelayMs must be a non-negative integer!`);
197
194
  }
198
195
  this.manualValueRefreshDelayMs =
@@ -200,44 +197,44 @@ compat option manualValueRefreshDelayMs must be a non-negative integer!`);
200
197
  }
201
198
  if (definition.reportTimeout != undefined) {
202
199
  if (typeof definition.reportTimeout !== "number") {
203
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
200
+ throwInvalidConfig("devices", `config/devices/${filename}:
204
201
  compat option reportTimeout must be a number!`);
205
202
  }
206
203
  if (definition.reportTimeout % 1 !== 0
207
204
  || definition.reportTimeout < 1000
208
205
  || definition.reportTimeout > 10000) {
209
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
206
+ throwInvalidConfig("devices", `config/devices/${filename}:
210
207
  compat option reportTimeout must be an integer between 1000 and 10000!`);
211
208
  }
212
209
  this.reportTimeout = definition.reportTimeout;
213
210
  }
214
211
  if (definition.mapRootReportsToEndpoint != undefined) {
215
212
  if (typeof definition.mapRootReportsToEndpoint !== "number") {
216
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
213
+ throwInvalidConfig("devices", `config/devices/${filename}:
217
214
  compat option mapRootReportsToEndpoint must be a number!`);
218
215
  }
219
216
  if (definition.mapRootReportsToEndpoint % 1 !== 0
220
217
  || definition.mapRootReportsToEndpoint < 1) {
221
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
218
+ throwInvalidConfig("devices", `config/devices/${filename}:
222
219
  compat option mapRootReportsToEndpoint must be a positive integer!`);
223
220
  }
224
221
  this.mapRootReportsToEndpoint = definition.mapRootReportsToEndpoint;
225
222
  }
226
223
  if (definition.overrideFloatEncoding != undefined) {
227
- if (!(0, typeguards_1.isObject)(definition.overrideFloatEncoding)) {
228
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
224
+ if (!isObject(definition.overrideFloatEncoding)) {
225
+ throwInvalidConfig("devices", `config/devices/${filename}:
229
226
  error in compat option overrideFloatEncoding`);
230
227
  }
231
228
  this.overrideFloatEncoding = {};
232
229
  if ("precision" in definition.overrideFloatEncoding) {
233
230
  if (typeof definition.overrideFloatEncoding.precision
234
231
  != "number") {
235
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
232
+ throwInvalidConfig("devices", `config/devices/${filename}:
236
233
  compat option overrideFloatEncoding.precision must be a number!`);
237
234
  }
238
235
  if (definition.overrideFloatEncoding.precision % 1 !== 0
239
236
  || definition.overrideFloatEncoding.precision < 0) {
240
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
237
+ throwInvalidConfig("devices", `config/devices/${filename}:
241
238
  compat option overrideFloatEncoding.precision must be a positive integer!`);
242
239
  }
243
240
  this.overrideFloatEncoding.precision =
@@ -245,43 +242,43 @@ compat option overrideFloatEncoding.precision must be a positive integer!`);
245
242
  }
246
243
  if ("size" in definition.overrideFloatEncoding) {
247
244
  if (typeof definition.overrideFloatEncoding.size != "number") {
248
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
245
+ throwInvalidConfig("devices", `config/devices/${filename}:
249
246
  compat option overrideFloatEncoding.size must be a number!`);
250
247
  }
251
248
  if (definition.overrideFloatEncoding.size % 1 !== 0
252
249
  || definition.overrideFloatEncoding.size < 1
253
250
  || definition.overrideFloatEncoding.size > 4) {
254
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
251
+ throwInvalidConfig("devices", `config/devices/${filename}:
255
252
  compat option overrideFloatEncoding.size must be an integer between 1 and 4!`);
256
253
  }
257
254
  this.overrideFloatEncoding.size =
258
255
  definition.overrideFloatEncoding.size;
259
256
  }
260
257
  if (Object.keys(this.overrideFloatEncoding).length === 0) {
261
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
258
+ throwInvalidConfig("devices", `config/devices/${filename}:
262
259
  error in compat option overrideFloatEncoding: size and/or precision must be specified!`);
263
260
  }
264
261
  }
265
262
  if (definition.commandClasses != undefined) {
266
- if (!(0, typeguards_1.isObject)(definition.commandClasses)) {
267
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
263
+ if (!isObject(definition.commandClasses)) {
264
+ throwInvalidConfig("devices", `config/devices/${filename}:
268
265
  error in compat option commandClasses`);
269
266
  }
270
267
  if (definition.commandClasses.add != undefined) {
271
- if (!(0, typeguards_1.isObject)(definition.commandClasses.add)) {
272
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
268
+ if (!isObject(definition.commandClasses.add)) {
269
+ throwInvalidConfig("devices", `config/devices/${filename}:
273
270
  error in compat option commandClasses.add`);
274
271
  }
275
- else if (!Object.values(definition.commandClasses.add).every((v) => (0, typeguards_1.isObject)(v))) {
276
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
272
+ else if (!Object.values(definition.commandClasses.add).every((v) => isObject(v))) {
273
+ throwInvalidConfig("devices", `config/devices/${filename}:
277
274
  All values in compat option commandClasses.add must be objects`);
278
275
  }
279
276
  const addCCs = new Map();
280
277
  for (const [key, info] of Object.entries(definition.commandClasses.add)) {
281
278
  // Parse the key into a CC ID
282
- const cc = (0, utils_safe_1.tryParseCCId)(key);
279
+ const cc = tryParseCCId(key);
283
280
  if (cc == undefined) {
284
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
281
+ throwInvalidConfig("devices", `config/devices/${filename}:
285
282
  Invalid Command Class "${key}" specified in compat option commandClasses.add!`);
286
283
  }
287
284
  addCCs.set(cc, new CompatAddCC(filename, info));
@@ -289,31 +286,31 @@ Invalid Command Class "${key}" specified in compat option commandClasses.add!`);
289
286
  this.addCCs = addCCs;
290
287
  }
291
288
  if (definition.commandClasses.remove != undefined) {
292
- if (!(0, typeguards_1.isObject)(definition.commandClasses.remove)) {
293
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
289
+ if (!isObject(definition.commandClasses.remove)) {
290
+ throwInvalidConfig("devices", `config/devices/${filename}:
294
291
  error in compat option commandClasses.remove`);
295
292
  }
296
293
  const removeCCs = new Map();
297
294
  for (const [key, info] of Object.entries(definition.commandClasses.remove)) {
298
295
  // Parse the key into a CC ID
299
- const cc = (0, utils_safe_1.tryParseCCId)(key);
296
+ const cc = tryParseCCId(key);
300
297
  if (cc == undefined) {
301
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
298
+ throwInvalidConfig("devices", `config/devices/${filename}:
302
299
  Invalid Command Class "${key}" specified in compat option commandClasses.remove!`);
303
300
  }
304
- if ((0, typeguards_1.isObject)(info) && "endpoints" in info) {
301
+ if (isObject(info) && "endpoints" in info) {
305
302
  if (info.endpoints === "*"
306
- || ((0, typeguards_1.isArray)(info.endpoints)
303
+ || (isArray(info.endpoints)
307
304
  && info.endpoints.every((i) => typeof i === "number"))) {
308
305
  removeCCs.set(cc, info.endpoints);
309
306
  }
310
307
  else {
311
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
308
+ throwInvalidConfig("devices", `config/devices/${filename}:
312
309
  Compat option commandClasses.remove has an invalid "endpoints" property. Only "*" and numeric arrays are allowed!`);
313
310
  }
314
311
  }
315
312
  else {
316
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
313
+ throwInvalidConfig("devices", `config/devices/${filename}:
317
314
  All values in compat option commandClasses.remove must be objects with an "endpoints" property!`);
318
315
  }
319
316
  }
@@ -321,16 +318,16 @@ All values in compat option commandClasses.remove must be objects with an "endpo
321
318
  }
322
319
  }
323
320
  if (definition.alarmMapping != undefined) {
324
- if (!(0, typeguards_1.isArray)(definition.alarmMapping)
325
- || !definition.alarmMapping.every((m) => (0, typeguards_1.isObject)(m))) {
326
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
321
+ if (!isArray(definition.alarmMapping)
322
+ || !definition.alarmMapping.every((m) => isObject(m))) {
323
+ throwInvalidConfig("devices", `config/devices/${filename}:
327
324
  compat option alarmMapping must be an array where all items are objects!`);
328
325
  }
329
326
  this.alarmMapping = definition.alarmMapping.map((m, i) => new CompatMapAlarm(filename, m, i + 1));
330
327
  }
331
328
  if (definition.overrideQueries != undefined) {
332
- if (!(0, typeguards_1.isObject)(definition.overrideQueries)) {
333
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
329
+ if (!isObject(definition.overrideQueries)) {
330
+ throwInvalidConfig("devices", `config/devices/${filename}:
334
331
  compat option overrideQueries must be an object!`);
335
332
  }
336
333
  this.overrideQueries = new CompatOverrideQueries(filename, definition.overrideQueries);
@@ -365,9 +362,9 @@ compat option overrideQueries must be an object!`);
365
362
  queryOnWakeup;
366
363
  condition;
367
364
  evaluateCondition(deviceId) {
368
- if (!(0, ConditionalItem_1.conditionApplies)(this, deviceId))
365
+ if (!conditionApplies(this, deviceId))
369
366
  return;
370
- const ret = (0, safe_2.pick)(this, [
367
+ const ret = pick(this, [
371
368
  "alarmMapping",
372
369
  "addCCs",
373
370
  "removeCCs",
@@ -396,18 +393,17 @@ compat option overrideQueries must be an object!`);
396
393
  "useUTCInTimeParametersCC",
397
394
  "queryOnWakeup",
398
395
  ]);
399
- return (0, safe_1.stripUndefined)(ret);
396
+ return stripUndefined(ret);
400
397
  }
401
398
  }
402
- exports.ConditionalCompatConfig = ConditionalCompatConfig;
403
- class CompatAddCC {
399
+ export class CompatAddCC {
404
400
  constructor(filename, definition) {
405
401
  const endpoints = new Map();
406
402
  const parseEndpointInfo = (endpoint, info) => {
407
403
  const parsed = {};
408
404
  if (info.isSupported != undefined) {
409
405
  if (typeof info.isSupported !== "boolean") {
410
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
406
+ throwInvalidConfig("devices", `config/devices/${filename}:
411
407
  Property isSupported in compat option commandClasses.add, endpoint ${endpoint} must be a boolean!`);
412
408
  }
413
409
  else {
@@ -416,7 +412,7 @@ Property isSupported in compat option commandClasses.add, endpoint ${endpoint} m
416
412
  }
417
413
  if (info.isControlled != undefined) {
418
414
  if (typeof info.isControlled !== "boolean") {
419
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
415
+ throwInvalidConfig("devices", `config/devices/${filename}:
420
416
  Property isControlled in compat option commandClasses.add, endpoint ${endpoint} must be a boolean!`);
421
417
  }
422
418
  else {
@@ -425,7 +421,7 @@ Property isControlled in compat option commandClasses.add, endpoint ${endpoint}
425
421
  }
426
422
  if (info.secure != undefined) {
427
423
  if (typeof info.secure !== "boolean") {
428
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
424
+ throwInvalidConfig("devices", `config/devices/${filename}:
429
425
  Property secure in compat option commandClasses.add, endpoint ${endpoint} must be a boolean!`);
430
426
  }
431
427
  else {
@@ -434,7 +430,7 @@ Property secure in compat option commandClasses.add, endpoint ${endpoint} must b
434
430
  }
435
431
  if (info.version != undefined) {
436
432
  if (typeof info.version !== "number") {
437
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
433
+ throwInvalidConfig("devices", `config/devices/${filename}:
438
434
  Property version in compat option commandClasses.add, endpoint ${endpoint} must be a number!`);
439
435
  }
440
436
  else {
@@ -452,9 +448,9 @@ Property version in compat option commandClasses.add, endpoint ${endpoint} must
452
448
  parseEndpointInfo(0, definition);
453
449
  }
454
450
  // Parse all other endpoints
455
- if ((0, typeguards_1.isObject)(definition.endpoints)) {
451
+ if (isObject(definition.endpoints)) {
456
452
  if (!Object.keys(definition.endpoints).every((k) => /^\d+$/.test(k))) {
457
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
453
+ throwInvalidConfig("devices", `config/devices/${filename}:
458
454
  invalid endpoint index in compat option commandClasses.add`);
459
455
  }
460
456
  else {
@@ -467,54 +463,53 @@ invalid endpoint index in compat option commandClasses.add`);
467
463
  }
468
464
  endpoints;
469
465
  }
470
- exports.CompatAddCC = CompatAddCC;
471
- class CompatMapAlarm {
466
+ export class CompatMapAlarm {
472
467
  constructor(filename, definition, index) {
473
- if (!(0, typeguards_1.isObject)(definition.from)) {
474
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
468
+ if (!isObject(definition.from)) {
469
+ throwInvalidConfig("devices", `config/devices/${filename}:
475
470
  error in compat option alarmMapping, mapping #${index}: property "from" must be an object!`);
476
471
  }
477
472
  else {
478
473
  if (typeof definition.from.alarmType !== "number") {
479
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
474
+ throwInvalidConfig("devices", `config/devices/${filename}:
480
475
  error in compat option alarmMapping, mapping #${index}: property "from.alarmType" must be a number!`);
481
476
  }
482
477
  if (definition.from.alarmLevel != undefined
483
478
  && typeof definition.from.alarmLevel !== "number") {
484
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
479
+ throwInvalidConfig("devices", `config/devices/${filename}:
485
480
  error in compat option alarmMapping, mapping #${index}: if property "from.alarmLevel" is given, it must be a number!`);
486
481
  }
487
482
  }
488
- if (!(0, typeguards_1.isObject)(definition.to)) {
489
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
483
+ if (!isObject(definition.to)) {
484
+ throwInvalidConfig("devices", `config/devices/${filename}:
490
485
  error in compat option alarmMapping, mapping #${index}: property "to" must be an object!`);
491
486
  }
492
487
  else {
493
488
  if (typeof definition.to.notificationType !== "number") {
494
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
489
+ throwInvalidConfig("devices", `config/devices/${filename}:
495
490
  error in compat option alarmMapping, mapping #${index}: property "to.notificationType" must be a number!`);
496
491
  }
497
492
  if (typeof definition.to.notificationEvent !== "number") {
498
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
493
+ throwInvalidConfig("devices", `config/devices/${filename}:
499
494
  error in compat option alarmMapping, mapping #${index}: property "to.notificationEvent" must be a number!`);
500
495
  }
501
496
  if (definition.to.eventParameters != undefined) {
502
- if (!(0, typeguards_1.isObject)(definition.to.eventParameters)) {
503
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
497
+ if (!isObject(definition.to.eventParameters)) {
498
+ throwInvalidConfig("devices", `config/devices/${filename}:
504
499
  error in compat option alarmMapping, mapping #${index}: property "to.eventParameters" must be an object!`);
505
500
  }
506
501
  else {
507
502
  for (const [key, val] of Object.entries(definition.to.eventParameters)) {
508
503
  if (typeof val !== "number" && val !== "alarmLevel") {
509
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
504
+ throwInvalidConfig("devices", `config/devices/${filename}:
510
505
  error in compat option alarmMapping, mapping #${index}: property "to.eventParameters.${key}" must be a number or the literal "alarmLevel"!`);
511
506
  }
512
507
  }
513
508
  }
514
509
  }
515
510
  }
516
- this.from = (0, safe_2.pick)(definition.from, ["alarmType", "alarmLevel"]);
517
- this.to = (0, safe_2.pick)(definition.to, [
511
+ this.from = pick(definition.from, ["alarmType", "alarmLevel"]);
512
+ this.to = pick(definition.to, [
518
513
  "notificationType",
519
514
  "notificationEvent",
520
515
  "eventParameters",
@@ -523,36 +518,35 @@ error in compat option alarmMapping, mapping #${index}: property "to.eventParame
523
518
  from;
524
519
  to;
525
520
  }
526
- exports.CompatMapAlarm = CompatMapAlarm;
527
- class CompatOverrideQueries {
521
+ export class CompatOverrideQueries {
528
522
  constructor(filename, definition) {
529
523
  const overrides = new Map();
530
524
  const parseOverride = (cc, info) => {
531
525
  if (typeof info.method !== "string") {
532
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
533
- Property "method" in compat option overrideQueries, CC ${(0, safe_1.getCCName)(cc)} must be a string!`);
526
+ throwInvalidConfig("devices", `config/devices/${filename}:
527
+ Property "method" in compat option overrideQueries, CC ${getCCName(cc)} must be a string!`);
534
528
  }
535
529
  else if (info.matchArgs != undefined
536
- && !(0, typeguards_1.isArray)(info.matchArgs)) {
537
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
538
- Property "matchArgs" in compat option overrideQueries, CC ${(0, safe_1.getCCName)(cc)} must be an array!`);
530
+ && !isArray(info.matchArgs)) {
531
+ throwInvalidConfig("devices", `config/devices/${filename}:
532
+ Property "matchArgs" in compat option overrideQueries, CC ${getCCName(cc)} must be an array!`);
539
533
  }
540
534
  else if (!("result" in info)) {
541
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
542
- Property "result" is missing in in compat option overrideQueries, CC ${(0, safe_1.getCCName)(cc)}!`);
535
+ throwInvalidConfig("devices", `config/devices/${filename}:
536
+ Property "result" is missing in in compat option overrideQueries, CC ${getCCName(cc)}!`);
543
537
  }
544
538
  else if (info.endpoint != undefined
545
539
  && typeof info.endpoint !== "number") {
546
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
547
- Property "endpoint" in compat option overrideQueries, CC ${(0, safe_1.getCCName)(cc)} must be a number!`);
540
+ throwInvalidConfig("devices", `config/devices/${filename}:
541
+ Property "endpoint" in compat option overrideQueries, CC ${getCCName(cc)} must be a number!`);
548
542
  }
549
- else if (info.persistValues && !(0, typeguards_1.isObject)(info.persistValues)) {
550
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
551
- Property "persistValues" in compat option overrideQueries, CC ${(0, safe_1.getCCName)(cc)} must be an object!`);
543
+ else if (info.persistValues && !isObject(info.persistValues)) {
544
+ throwInvalidConfig("devices", `config/devices/${filename}:
545
+ Property "persistValues" in compat option overrideQueries, CC ${getCCName(cc)} must be an object!`);
552
546
  }
553
- else if (info.extendMetadata && !(0, typeguards_1.isObject)(info.extendMetadata)) {
554
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
555
- Property "extendMetadata" in compat option overrideQueries, CC ${(0, safe_1.getCCName)(cc)} must be an object!`);
547
+ else if (info.extendMetadata && !isObject(info.extendMetadata)) {
548
+ throwInvalidConfig("devices", `config/devices/${filename}:
549
+ Property "extendMetadata" in compat option overrideQueries, CC ${getCCName(cc)} must be an object!`);
556
550
  }
557
551
  return {
558
552
  endpoint: info.endpoint,
@@ -565,17 +559,17 @@ Property "extendMetadata" in compat option overrideQueries, CC ${(0, safe_1.getC
565
559
  };
566
560
  for (const [key, value] of Object.entries(definition)) {
567
561
  // Parse the key into a CC ID
568
- const cc = (0, utils_safe_1.tryParseCCId)(key);
562
+ const cc = tryParseCCId(key);
569
563
  if (cc == undefined) {
570
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
564
+ throwInvalidConfig("devices", `config/devices/${filename}:
571
565
  Invalid Command Class "${key}" specified in compat option overrideQueries!`);
572
566
  }
573
567
  let overrideDefinitions;
574
- if ((0, typeguards_1.isObject)(value)) {
568
+ if (isObject(value)) {
575
569
  overrideDefinitions = [value];
576
570
  }
577
- else if (!(0, typeguards_1.isArray)(value)) {
578
- (0, utils_safe_1.throwInvalidConfig)("devices", `config/devices/${filename}:
571
+ else if (!isArray(value)) {
572
+ throwInvalidConfig("devices", `config/devices/${filename}:
579
573
  Property "${key}" in compat option overrideQueries must be a single override object or an array thereof!`);
580
574
  }
581
575
  else {
@@ -606,11 +600,10 @@ Property "${key}" in compat option overrideQueries must be a single override obj
606
600
  continue;
607
601
  }
608
602
  }
609
- return (0, safe_2.pick)(query, ["result", "persistValues", "extendMetadata"]);
603
+ return pick(query, ["result", "persistValues", "extendMetadata"]);
610
604
  }
611
605
  }
612
606
  }
613
- exports.CompatOverrideQueries = CompatOverrideQueries;
614
607
  const basicReportMappings = [
615
608
  false,
616
609
  "auto",