hm-simulator 1.1.0 → 1.2.0
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.
- package/CHANGELOG.md +106 -0
- package/README.md +596 -238
- package/data/fixtures/lab-2026-09.json +45956 -0
- package/index.js +260 -47
- package/lib/control.js +132 -0
- package/lib/method-help.js +4 -0
- package/lib/paramset-index.js +107 -0
- package/lib/servers.js +262 -13
- package/lib/sim.js +963 -59
- package/lib/validate.js +4 -0
- package/package.json +2 -1
package/lib/validate.js
CHANGED
|
@@ -98,6 +98,10 @@ function castValue(description, name, value, fault, {write = true} = {}) {
|
|
|
98
98
|
/** The value a parameter has before anything was written, taken from its description. */
|
|
99
99
|
function defaultValue(parameter) {
|
|
100
100
|
if (parameter.TYPE === 'ENUM' && Array.isArray(parameter.VALUE_LIST)) {
|
|
101
|
+
// the descriptions carry DEFAULT as the name or, as often, already as the index
|
|
102
|
+
if (Number.isInteger(parameter.DEFAULT)) {
|
|
103
|
+
return parameter.DEFAULT;
|
|
104
|
+
}
|
|
101
105
|
const index = parameter.VALUE_LIST.indexOf(parameter.DEFAULT);
|
|
102
106
|
return index === -1 ? 0 : index;
|
|
103
107
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hm-simulator",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Simulates a Homematic CCU (rfd, hmipserver, VirtualDevices, CUxD, ReGa) for automated tests",
|
|
5
5
|
"main": "sim.js",
|
|
6
6
|
"preferGlobal": true,
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
"data/",
|
|
49
49
|
"behaviors/",
|
|
50
50
|
"README.md",
|
|
51
|
+
"CHANGELOG.md",
|
|
51
52
|
"LICENSE"
|
|
52
53
|
],
|
|
53
54
|
"dependencies": {
|