signalk-shelly2 1.6.0 → 1.7.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/dist/components/Component.d.ts +28 -0
- package/dist/components/Component.d.ts.map +1 -0
- package/dist/components/Component.js +148 -0
- package/dist/components/Component.js.map +1 -0
- package/dist/components/Devicepower.d.ts +7 -0
- package/dist/components/Devicepower.d.ts.map +1 -0
- package/dist/components/Devicepower.js +50 -0
- package/dist/components/Devicepower.js.map +1 -0
- package/dist/components/EM.d.ts +7 -0
- package/dist/components/EM.d.ts.map +1 -0
- package/dist/components/EM.js +164 -0
- package/dist/components/EM.js.map +1 -0
- package/dist/components/EM1.d.ts +7 -0
- package/dist/components/EM1.d.ts.map +1 -0
- package/dist/components/EM1.js +65 -0
- package/dist/components/EM1.js.map +1 -0
- package/dist/components/Humidity.d.ts +7 -0
- package/dist/components/Humidity.d.ts.map +1 -0
- package/dist/components/Humidity.js +39 -0
- package/dist/components/Humidity.js.map +1 -0
- package/dist/components/Input.d.ts +7 -0
- package/dist/components/Input.d.ts.map +1 -0
- package/dist/components/Input.js +76 -0
- package/dist/components/Input.js.map +1 -0
- package/dist/components/Light.d.ts +8 -0
- package/dist/components/Light.d.ts.map +1 -0
- package/dist/components/Light.js +41 -0
- package/dist/components/Light.js.map +1 -0
- package/dist/components/PM1.d.ts +7 -0
- package/dist/components/PM1.d.ts.map +1 -0
- package/dist/components/PM1.js +89 -0
- package/dist/components/PM1.js.map +1 -0
- package/dist/components/RGB.d.ts +12 -0
- package/dist/components/RGB.d.ts.map +1 -0
- package/dist/components/RGB.js +149 -0
- package/dist/components/RGB.js.map +1 -0
- package/dist/components/RGBW.d.ts +8 -0
- package/dist/components/RGBW.d.ts.map +1 -0
- package/dist/components/RGBW.js +36 -0
- package/dist/components/RGBW.js.map +1 -0
- package/dist/components/Smoke.d.ts +9 -0
- package/dist/components/Smoke.d.ts.map +1 -0
- package/dist/components/Smoke.js +49 -0
- package/dist/components/Smoke.js.map +1 -0
- package/dist/components/Switch.d.ts +8 -0
- package/dist/components/Switch.d.ts.map +1 -0
- package/dist/components/Switch.js +54 -0
- package/dist/components/Switch.js.map +1 -0
- package/dist/components/SwitchBase.d.ts +5 -0
- package/dist/components/SwitchBase.d.ts.map +1 -0
- package/dist/components/SwitchBase.js +74 -0
- package/dist/components/SwitchBase.js.map +1 -0
- package/dist/components/Temperature.d.ts +7 -0
- package/dist/components/Temperature.d.ts.map +1 -0
- package/dist/components/Temperature.js +37 -0
- package/dist/components/Temperature.js.map +1 -0
- package/dist/components/Voltmeter.d.ts +7 -0
- package/dist/components/Voltmeter.d.ts.map +1 -0
- package/dist/components/Voltmeter.js +35 -0
- package/dist/components/Voltmeter.js.map +1 -0
- package/dist/components/index.d.ts +10 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/index.js +114 -0
- package/dist/components/index.js.map +1 -0
- package/dist/device.d.ts +22 -22
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +107 -864
- package/dist/device.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +22 -28
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/test/device.ts +3 -87
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Device } from '../device';
|
|
2
|
+
import { ServerAPI, Meta, Path, PathValue } from '@signalk/server-api';
|
|
3
|
+
export type ComponentPath = {
|
|
4
|
+
key: string;
|
|
5
|
+
path?: string;
|
|
6
|
+
converter?: (value: any) => any;
|
|
7
|
+
putHandler?: (device: Device, id: number, value: any) => Promise<void>;
|
|
8
|
+
meta?: any;
|
|
9
|
+
};
|
|
10
|
+
export declare abstract class Component {
|
|
11
|
+
device: Device;
|
|
12
|
+
componentId: number;
|
|
13
|
+
componentName: string;
|
|
14
|
+
skPath: string;
|
|
15
|
+
apiName: string;
|
|
16
|
+
flatten: boolean;
|
|
17
|
+
constructor(device: Device, componentId: number, componentName: string, apiName: string, skPath: string, flatten?: boolean);
|
|
18
|
+
abstract getPaths(): ComponentPath[];
|
|
19
|
+
registerPuts(app: ServerAPI): void;
|
|
20
|
+
getDeltaValues(status: any): PathValue[];
|
|
21
|
+
getMeta(): Meta[];
|
|
22
|
+
setValue(getKey: string, setKey: string, value: any): Promise<void>;
|
|
23
|
+
getStatus(): Promise<any>;
|
|
24
|
+
getComponentPath(key: string | undefined): Path;
|
|
25
|
+
temperatureConverter(value: number): number;
|
|
26
|
+
percentConverter(value: number): number;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=Component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.d.ts","sourceRoot":"","sources":["../../src/components/Component.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EACL,SAAS,EAET,IAAI,EACJ,IAAI,EACJ,SAAS,EACV,MAAM,qBAAqB,CAAA;AAE5B,MAAM,MAAM,aAAa,GAAG;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;IAC/B,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACtE,IAAI,CAAC,EAAE,GAAG,CAAA;CACX,CAAA;AAED,8BAAsB,SAAS;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,aAAa,EAAE,MAAM,CAAA;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,OAAO,CAAA;gBAGd,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,OAAO,GAAE,OAAc;IAUzB,QAAQ,CAAC,QAAQ,IAAI,aAAa,EAAE;IAEpC,YAAY,CAAC,GAAG,EAAE,SAAS;IAmC3B,cAAc,CAAC,MAAM,EAAE,GAAG,GAAG,SAAS,EAAE;IAmBxC,OAAO,IAAI,IAAI,EAAE;IAyBX,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;IAgBnD,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC;IAO/B,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAsB/C,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAIlC,gBAAgB,CAAC,KAAK,EAAE,MAAM;CAG/B"}
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Scott Bender <scott@scottbender.net>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Component = void 0;
|
|
18
|
+
class Component {
|
|
19
|
+
device;
|
|
20
|
+
componentId;
|
|
21
|
+
componentName;
|
|
22
|
+
skPath;
|
|
23
|
+
apiName;
|
|
24
|
+
flatten;
|
|
25
|
+
constructor(device, componentId, componentName, apiName, skPath, flatten = true) {
|
|
26
|
+
this.device = device;
|
|
27
|
+
this.componentName = componentName;
|
|
28
|
+
this.skPath = skPath;
|
|
29
|
+
this.apiName = apiName;
|
|
30
|
+
this.flatten = flatten;
|
|
31
|
+
this.componentId = componentId;
|
|
32
|
+
}
|
|
33
|
+
registerPuts(app) {
|
|
34
|
+
this.getPaths().forEach((p) => {
|
|
35
|
+
if (p.putHandler !== undefined) {
|
|
36
|
+
app.registerPutHandler('vessels.self', this.getComponentPath(p.path || p.key), (context, path, value, cb) => {
|
|
37
|
+
p.putHandler(this.device, this.componentId, value)
|
|
38
|
+
.then(() => {
|
|
39
|
+
cb({
|
|
40
|
+
state: 'COMPLETED',
|
|
41
|
+
statusCode: 200
|
|
42
|
+
});
|
|
43
|
+
})
|
|
44
|
+
.catch((err) => {
|
|
45
|
+
app.error(err.message);
|
|
46
|
+
app.setPluginError(err.message);
|
|
47
|
+
cb({
|
|
48
|
+
state: 'COMPLETED',
|
|
49
|
+
statusCode: 400,
|
|
50
|
+
message: err.message
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
return { state: 'PENDING' };
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
getDeltaValues(status) {
|
|
59
|
+
const values = [];
|
|
60
|
+
const componentStatus = status[`${this.componentName}:${this.componentId}`];
|
|
61
|
+
if (componentStatus) {
|
|
62
|
+
this.getPaths().forEach((p) => {
|
|
63
|
+
const val = deepGet(componentStatus, p.key);
|
|
64
|
+
const converter = p.converter;
|
|
65
|
+
if (val !== undefined) {
|
|
66
|
+
values.push({
|
|
67
|
+
path: this.getComponentPath(p.path || p.key),
|
|
68
|
+
value: converter ? converter(val) : val
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
return values;
|
|
74
|
+
}
|
|
75
|
+
getMeta() {
|
|
76
|
+
const meta = [];
|
|
77
|
+
const componentProps = this.device.getComponentProps(this.componentName, this.componentId);
|
|
78
|
+
this.getPaths().forEach((path) => {
|
|
79
|
+
const metaValue = {
|
|
80
|
+
...(path.meta || {}),
|
|
81
|
+
displayName: componentProps?.displayName || this.device.deviceSettings?.displayName
|
|
82
|
+
};
|
|
83
|
+
if (Object.keys(metaValue).length > 0) {
|
|
84
|
+
meta.push({
|
|
85
|
+
path: this.getComponentPath(path.path || path.key),
|
|
86
|
+
value: metaValue
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
return meta;
|
|
91
|
+
}
|
|
92
|
+
async setValue(getKey, setKey, value) {
|
|
93
|
+
await this.device.send(`${this.apiName}.Set`, {
|
|
94
|
+
id: this.componentId,
|
|
95
|
+
[setKey]: value
|
|
96
|
+
});
|
|
97
|
+
const status = await this.getStatus();
|
|
98
|
+
if (status[getKey] !== value) {
|
|
99
|
+
throw new Error(`Failed to set ${this.componentName} ${this.componentId} to ${value}`);
|
|
100
|
+
}
|
|
101
|
+
this.device.sendDeltas({
|
|
102
|
+
[`${this.componentName}:${this.componentId}`]: status
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
async getStatus() {
|
|
106
|
+
const res = await this.device.send(`${this.apiName}.GetStatus`, {
|
|
107
|
+
id: this.componentId
|
|
108
|
+
});
|
|
109
|
+
return res;
|
|
110
|
+
}
|
|
111
|
+
getComponentPath(key) {
|
|
112
|
+
const componentProps = this.device.getComponentProps(this.componentName, this.componentId);
|
|
113
|
+
let path = this.device.getDevicePath();
|
|
114
|
+
const count = this.device.components[this.componentName].length;
|
|
115
|
+
if (count > 1) {
|
|
116
|
+
if (this.flatten === false) {
|
|
117
|
+
path = path + `.${this.componentName}`;
|
|
118
|
+
}
|
|
119
|
+
path =
|
|
120
|
+
path +
|
|
121
|
+
`.${componentProps?.path || componentProps?.switchPath || this.componentId}`;
|
|
122
|
+
}
|
|
123
|
+
else if (count === 1 && this.flatten === false) {
|
|
124
|
+
path = path + `.${this.componentName}`;
|
|
125
|
+
}
|
|
126
|
+
return (path + (key ? '.' + key : ''));
|
|
127
|
+
}
|
|
128
|
+
temperatureConverter(value) {
|
|
129
|
+
return value + 273.15;
|
|
130
|
+
}
|
|
131
|
+
percentConverter(value) {
|
|
132
|
+
return value / 100;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
exports.Component = Component;
|
|
136
|
+
function deepGet(obj, path) {
|
|
137
|
+
const parts = path.split('.');
|
|
138
|
+
let current = obj;
|
|
139
|
+
for (const part of parts) {
|
|
140
|
+
if (current === null || typeof current !== 'object' || !(part in current)) {
|
|
141
|
+
// Handle cases where a part of the path is missing or not an object
|
|
142
|
+
return undefined; // Or throw an error
|
|
143
|
+
}
|
|
144
|
+
current = current[part];
|
|
145
|
+
}
|
|
146
|
+
return current;
|
|
147
|
+
}
|
|
148
|
+
//# sourceMappingURL=Component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Component.js","sourceRoot":"","sources":["../../src/components/Component.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAmBH,MAAsB,SAAS;IAC7B,MAAM,CAAQ;IACd,WAAW,CAAQ;IACnB,aAAa,CAAQ;IACrB,MAAM,CAAQ;IACd,OAAO,CAAQ;IACf,OAAO,CAAS;IAEhB,YACE,MAAc,EACd,WAAmB,EACnB,aAAqB,EACrB,OAAe,EACf,MAAc,EACd,UAAmB,IAAI;QAEvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,aAAa,GAAG,aAAa,CAAA;QAClC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAA;IAChC,CAAC;IAID,YAAY,CAAC,GAAc;QACzB,IAAI,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAgB,EAAE,EAAE;YAC3C,IAAI,CAAC,CAAC,UAAU,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,CAAC;YACD,IAAI;gBACF,IAAI;oBACJ,IAAI,cAAc,EAAE,IAAI,IAAI,cAAc,EAAE,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAA;QAChF,CAAC;aAAM,IAAI,KAAK,KAAK,CAAC,IAAI,IAAI,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;YACjD,IAAI,GAAG,IAAI,GAAG,IAAI,IAAI,CAAC,aAAa,EAAE,CAAA;QACxC,CAAC;QAED,OAAO,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAS,CAAA;IAChD,CAAC;IAED,oBAAoB,CAAC,KAAa;QAChC,OAAO,KAAK,GAAG,MAAM,CAAA;IACvB,CAAC;IAED,gBAAgB,CAAC,KAAa;QAC5B,OAAO,KAAK,GAAG,GAAG,CAAA;IACpB,CAAC;CACF;AA7JD,8BA6JC;AAUD,SAAS,OAAO,CAAsB,GAAM,EAAE,IAAO;IACnD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAA;IAC/C,IAAI,OAAO,GAAQ,GAAG,CAAA;IAEtB,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,OAAO,KAAK,IAAI,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,EAAE,CAAC;YAC1E,oEAAoE;YACpE,OAAO,SAA0B,CAAA,CAAC,oBAAoB;QACxD,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACzB,CAAC;IACD,OAAO,OAAwB,CAAA;AACjC,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Component, ComponentPath } from './Component';
|
|
2
|
+
import { Device } from '../device';
|
|
3
|
+
export declare class Devicepower extends Component {
|
|
4
|
+
constructor(device: Device, componentId: number);
|
|
5
|
+
getPaths(): ComponentPath[];
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=Devicepower.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Devicepower.d.ts","sourceRoot":"","sources":["../../src/components/Devicepower.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,qBAAa,WAAY,SAAQ,SAAS;gBAC5B,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAU/C,QAAQ,IAAI,aAAa,EAAE;CAyB5B"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Scott Bender <scott@scottbender.net>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Devicepower = void 0;
|
|
18
|
+
const Component_1 = require("./Component");
|
|
19
|
+
class Devicepower extends Component_1.Component {
|
|
20
|
+
constructor(device, componentId) {
|
|
21
|
+
super(device, componentId, 'devicepower', 'Devicepower', 'electrical.devicepower');
|
|
22
|
+
}
|
|
23
|
+
getPaths() {
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
key: 'battery.V',
|
|
27
|
+
path: 'battery.voltage',
|
|
28
|
+
meta: {
|
|
29
|
+
units: 'V'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: 'battery.percent',
|
|
34
|
+
converter: this.percentConverter.bind(this),
|
|
35
|
+
meta: {
|
|
36
|
+
units: 'ratio'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: 'external.present',
|
|
41
|
+
path: 'externalPower',
|
|
42
|
+
meta: {
|
|
43
|
+
units: 'bool'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.Devicepower = Devicepower;
|
|
50
|
+
//# sourceMappingURL=Devicepower.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Devicepower.js","sourceRoot":"","sources":["../../src/components/Devicepower.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAEH,2CAAsD;AAGtD,MAAa,WAAY,SAAQ,qBAAS;IACxC,YAAY,MAAc,EAAE,WAAmB;QAC7C,KAAK,CACH,MAAM,EACN,WAAW,EACX,aAAa,EACb,aAAa,EACb,wBAAwB,CACzB,CAAA;IACH,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,GAAG,EAAE,WAAW;gBAChB,IAAI,EAAE,iBAAiB;gBACvB,IAAI,EAAE;oBACJ,KAAK,EAAE,GAAG;iBACX;aACF;YACD;gBACE,GAAG,EAAE,iBAAiB;gBACtB,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC3C,IAAI,EAAE;oBACJ,KAAK,EAAE,OAAO;iBACf;aACF;YACD;gBACE,GAAG,EAAE,kBAAkB;gBACvB,IAAI,EAAE,eAAe;gBACrB,IAAI,EAAE;oBACJ,KAAK,EAAE,MAAM;iBACd;aACF;SACF,CAAA;IACH,CAAC;CACF;AApCD,kCAoCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EM.d.ts","sourceRoot":"","sources":["../../src/components/EM.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEtD,qBAAa,EAAG,SAAQ,SAAS;gBACnB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAI/C,QAAQ,IAAI,aAAa,EAAE;CA2I5B"}
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Scott Bender <scott@scottbender.net>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.EM = void 0;
|
|
18
|
+
const Component_1 = require("./Component");
|
|
19
|
+
class EM extends Component_1.Component {
|
|
20
|
+
constructor(device, componentId) {
|
|
21
|
+
super(device, componentId, 'em', 'EM', 'electrical.energymeter');
|
|
22
|
+
}
|
|
23
|
+
getPaths() {
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
key: 'a_current',
|
|
27
|
+
meta: {
|
|
28
|
+
units: 'A'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: 'a_voltage',
|
|
33
|
+
meta: {
|
|
34
|
+
units: 'V'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: 'a_act_power',
|
|
39
|
+
meta: {
|
|
40
|
+
units: 'W'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: 'a_aprt_power',
|
|
45
|
+
meta: {
|
|
46
|
+
units: 'VA'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: 'a_pf',
|
|
51
|
+
meta: {
|
|
52
|
+
units: 'ratio'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'a_freq',
|
|
57
|
+
meta: {
|
|
58
|
+
units: 'Hz'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: 'b_current',
|
|
63
|
+
meta: {
|
|
64
|
+
units: 'A'
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
key: 'b_voltage',
|
|
69
|
+
meta: {
|
|
70
|
+
units: 'V'
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
key: 'b_act_power',
|
|
75
|
+
meta: {
|
|
76
|
+
units: 'W'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
key: 'b_aprt_power',
|
|
81
|
+
meta: {
|
|
82
|
+
units: 'VA'
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
key: 'b_pf',
|
|
87
|
+
meta: {
|
|
88
|
+
units: 'ratio'
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
key: 'b_freq',
|
|
93
|
+
meta: {
|
|
94
|
+
units: 'Hz'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
key: 'c_current',
|
|
99
|
+
meta: {
|
|
100
|
+
units: 'A'
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
key: 'c_voltage',
|
|
105
|
+
meta: {
|
|
106
|
+
units: 'V'
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
key: 'c_act_power',
|
|
111
|
+
meta: {
|
|
112
|
+
units: 'W'
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
key: 'c_aprt_power',
|
|
117
|
+
meta: {
|
|
118
|
+
units: 'VA'
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
key: 'c_pf',
|
|
123
|
+
meta: {
|
|
124
|
+
units: 'ratio'
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
key: 'c_freq',
|
|
129
|
+
meta: {
|
|
130
|
+
units: 'Hz'
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
key: 'n_current',
|
|
135
|
+
meta: {
|
|
136
|
+
units: 'A'
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
key: 'total_current',
|
|
141
|
+
meta: {
|
|
142
|
+
units: 'A'
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
key: 'total_act_power',
|
|
147
|
+
meta: {
|
|
148
|
+
units: 'W'
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
key: 'total_aprt_power',
|
|
153
|
+
meta: {
|
|
154
|
+
units: 'VA'
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: 'user_calibrated_phase'
|
|
159
|
+
}
|
|
160
|
+
];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
exports.EM = EM;
|
|
164
|
+
//# sourceMappingURL=EM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EM.js","sourceRoot":"","sources":["../../src/components/EM.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AA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AAE,WAAW;gBAChB,IAAI,EAAE;oBACJ,KAAK,EAAE,GAAG;iBACX;aACF;YACD;gBACE,GAAG,EAAE,WAAW;gBAChB,IAAI,EAAE;oBACJ,KAAK,EAAE,GAAG;iBACX;aACF;YACD;gBACE,GAAG,EAAE,aAAa;gBAClB,IAAI,EAAE;oBACJ,KAAK,EAAE,GAAG;iBACX;aACF;YACD;gBACE,GAAG,EAAE,cAAc;gBACnB,IAAI,EAAE;oBACJ,KAAK,EAAE,IAAI;iBACZ;aACF;YACD;gBACE,GAAG,EAAE,MAAM;gBACX,IAAI,EAAE;oBACJ,KAAK,EAAE,OAAO;iBACf;aACF;YACD;gBACE,GAAG,EAAE,QAAQ;gBACb,IAAI,EAAE;oBACJ,KAAK,EAAE,IAAI;iBACZ;aACF;YACD;gBACE,GAAG,EAAE,WAAW;gBAChB,IAAI,EAAE;oBACJ,KAAK,EAAE,GAAG;iBACX;aACF;YACD;gBACE,GAAG,EAAE,eAAe;gBACpB,IAAI,EAAE;oBACJ,KAAK,EAAE,GAAG;iBACX;aACF;YACD;gBACE,GAAG,EAAE,iBAAiB;gBACtB,IAAI,EAAE;oBACJ,KAAK,EAAE,GAAG;iBACX;aACF;YACD;gBACE,GAAG,EAAE,kBAAkB;gBACvB,IAAI,EAAE;oBACJ,KAAK,EAAE,IAAI;iBACZ;aACF;YACD;gBACE,GAAG,EAAE,uBAAuB;aAC7B;SACF,CAAA;IACH,CAAC;CACF;AAhJD,gBAgJC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EM1.d.ts","sourceRoot":"","sources":["../../src/components/EM1.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEtD,qBAAa,GAAI,SAAQ,SAAS;gBACpB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAI/C,QAAQ,IAAI,aAAa,EAAE;CAwC5B"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Scott Bender <scott@scottbender.net>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.EM1 = void 0;
|
|
18
|
+
const Component_1 = require("./Component");
|
|
19
|
+
class EM1 extends Component_1.Component {
|
|
20
|
+
constructor(device, componentId) {
|
|
21
|
+
super(device, componentId, 'em1', 'EM1', 'electrical.energymeter');
|
|
22
|
+
}
|
|
23
|
+
getPaths() {
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
key: 'current',
|
|
27
|
+
meta: {
|
|
28
|
+
units: 'A'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: 'voltage',
|
|
33
|
+
meta: {
|
|
34
|
+
units: 'V'
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
key: 'act_power',
|
|
39
|
+
meta: {
|
|
40
|
+
units: 'W'
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
key: 'aprt_power',
|
|
45
|
+
meta: {
|
|
46
|
+
units: 'VA'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: 'pf',
|
|
51
|
+
meta: {
|
|
52
|
+
units: 'ratio'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'freq',
|
|
57
|
+
meta: {
|
|
58
|
+
units: 'Hz'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.EM1 = EM1;
|
|
65
|
+
//# sourceMappingURL=EM1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EM1.js","sourceRoot":"","sources":["../../src/components/EM1.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAGH,2CAAsD;AAEtD,MAAa,GAAI,SAAQ,qBAAS;IAChC,YAAY,MAAc,EAAE,WAAmB;QAC7C,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAA;IACpE,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,GAAG,EAAE,SAAS;gBACd,IAAI,EAAE;oBACJ,KAAK,EAAE,GAAG;iBACX;aACF;YACD;gBACE,GAAG,EAAE,SAAS;gBACd,IAAI,EAAE;oBACJ,KAAK,EAAE,GAAG;iBACX;aACF;YACD;gBACE,GAAG,EAAE,WAAW;gBAChB,IAAI,EAAE;oBACJ,KAAK,EAAE,GAAG;iBACX;aACF;YACD;gBACE,GAAG,EAAE,YAAY;gBACjB,IAAI,EAAE;oBACJ,KAAK,EAAE,IAAI;iBACZ;aACF;YACD;gBACE,GAAG,EAAE,IAAI;gBACT,IAAI,EAAE;oBACJ,KAAK,EAAE,OAAO;iBACf;aACF;YACD;gBACE,GAAG,EAAE,MAAM;gBACX,IAAI,EAAE;oBACJ,KAAK,EAAE,IAAI;iBACZ;aACF;SACF,CAAA;IACH,CAAC;CACF;AA7CD,kBA6CC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Device } from '../device';
|
|
2
|
+
import { Component, ComponentPath } from './Component';
|
|
3
|
+
export declare class Humidity extends Component {
|
|
4
|
+
constructor(device: Device, componentId: number);
|
|
5
|
+
getPaths(): ComponentPath[];
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=Humidity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Humidity.d.ts","sourceRoot":"","sources":["../../src/components/Humidity.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEtD,qBAAa,QAAS,SAAQ,SAAS;gBACzB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAI/C,QAAQ,IAAI,aAAa,EAAE;CAc5B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Scott Bender <scott@scottbender.net>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Humidity = void 0;
|
|
18
|
+
const Component_1 = require("./Component");
|
|
19
|
+
class Humidity extends Component_1.Component {
|
|
20
|
+
constructor(device, componentId) {
|
|
21
|
+
super(device, componentId, 'humidity', 'Humidity', 'environment');
|
|
22
|
+
}
|
|
23
|
+
getPaths() {
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
key: 'rh',
|
|
27
|
+
path: 'humidity',
|
|
28
|
+
converter: (value) => {
|
|
29
|
+
return value / 100;
|
|
30
|
+
},
|
|
31
|
+
meta: {
|
|
32
|
+
units: 'ratio'
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.Humidity = Humidity;
|
|
39
|
+
//# sourceMappingURL=Humidity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Humidity.js","sourceRoot":"","sources":["../../src/components/Humidity.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAGH,2CAAsD;AAEtD,MAAa,QAAS,SAAQ,qBAAS;IACrC,YAAY,MAAc,EAAE,WAAmB;QAC7C,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,aAAa,CAAC,CAAA;IACnE,CAAC;IAED,QAAQ;QACN,OAAO;YACL;gBACE,GAAG,EAAE,IAAI;gBACT,IAAI,EAAE,UAAU;gBAChB,SAAS,EAAE,CAAC,KAAU,EAAE,EAAE;oBACxB,OAAO,KAAK,GAAG,GAAG,CAAA;gBACpB,CAAC;gBACD,IAAI,EAAE;oBACJ,KAAK,EAAE,OAAO;iBACf;aACF;SACF,CAAA;IACH,CAAC;CACF;AAnBD,4BAmBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../src/components/Input.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEtD,qBAAa,KAAM,SAAQ,SAAS;gBACtB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM;IAI/C,QAAQ,IAAI,aAAa,EAAE;CAmD5B"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Scott Bender <scott@scottbender.net>
|
|
4
|
+
*
|
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.Input = void 0;
|
|
18
|
+
const Component_1 = require("./Component");
|
|
19
|
+
class Input extends Component_1.Component {
|
|
20
|
+
constructor(device, componentId) {
|
|
21
|
+
super(device, componentId, 'input', 'Input', 'electrical.inputs', false);
|
|
22
|
+
}
|
|
23
|
+
getPaths() {
|
|
24
|
+
return [
|
|
25
|
+
{
|
|
26
|
+
key: 'state',
|
|
27
|
+
path: 'on',
|
|
28
|
+
meta: {
|
|
29
|
+
units: 'bool'
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: 'percent',
|
|
34
|
+
converter: (v) => (v != undefined ? v / 100 : undefined),
|
|
35
|
+
meta: {
|
|
36
|
+
units: 'ratio'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
key: 'xpercent',
|
|
41
|
+
meta: {
|
|
42
|
+
units: 'ratio'
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
key: 'counts.total'
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
key: 'counts.xtotal'
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: 'counts.xby_minute'
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
key: 'counts.minute_ts'
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
key: 'counts.by_minute'
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: 'counts.freq',
|
|
62
|
+
meta: {
|
|
63
|
+
units: 'Hz'
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
key: 'counts.xfreq',
|
|
68
|
+
meta: {
|
|
69
|
+
units: 'Hz'
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
exports.Input = Input;
|
|
76
|
+
//# sourceMappingURL=Input.js.map
|