homebridge-tasmota 0.2.0-beta.2 → 0.2.0-beta.3
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/.github/workflows/build.yml +3 -3
- package/dist/TasmotaService.d.ts +3 -3
- package/dist/TasmotaService.js +28 -26
- package/dist/TasmotaService.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/CustomCharacteristics.d.ts +51 -2
- package/dist/lib/CustomCharacteristics.js +165 -135
- package/dist/lib/CustomCharacteristics.js.map +1 -1
- package/dist/lib/CustomCharacteristics.spec.d.ts +1 -0
- package/dist/lib/CustomCharacteristics.spec.js +136 -0
- package/dist/lib/CustomCharacteristics.spec.js.map +1 -0
- package/dist/lib/Mqtt.d.ts +0 -1
- package/dist/lib/Mqtt.js.map +1 -1
- package/dist/lib/testUtils.d.ts +1 -0
- package/dist/lib/testUtils.js +18 -0
- package/dist/lib/testUtils.js.map +1 -0
- package/dist/platform.d.ts +4 -5
- package/dist/platform.js +56 -67
- package/dist/platform.js.map +1 -1
- package/dist/settings.js.map +1 -1
- package/dist/tasmotaBinarySensorService.d.ts +1 -1
- package/dist/tasmotaBinarySensorService.js +23 -21
- package/dist/tasmotaBinarySensorService.js.map +1 -1
- package/dist/tasmotaFanService.d.ts +2 -2
- package/dist/tasmotaFanService.js +17 -15
- package/dist/tasmotaFanService.js.map +1 -1
- package/dist/tasmotaGarageService.d.ts +2 -2
- package/dist/tasmotaGarageService.js +1 -1
- package/dist/tasmotaGarageService.js.map +1 -1
- package/dist/tasmotaLightService.d.ts +2 -2
- package/dist/tasmotaLightService.js +74 -70
- package/dist/tasmotaLightService.js.map +1 -1
- package/dist/tasmotaSensorService.js +47 -51
- package/dist/tasmotaSensorService.js.map +1 -1
- package/dist/tasmotaSwitchService.d.ts +2 -2
- package/dist/tasmotaSwitchService.js +12 -8
- package/dist/tasmotaSwitchService.js.map +1 -1
- package/eslint.config.js +31 -0
- package/notes.MD +1 -0
- package/package.json +49 -20
|
@@ -9,13 +9,13 @@ jobs:
|
|
|
9
9
|
strategy:
|
|
10
10
|
matrix:
|
|
11
11
|
# the Node.js versions to build on
|
|
12
|
-
node-version: [
|
|
12
|
+
node-version: [lts/*, latest]
|
|
13
13
|
|
|
14
14
|
steps:
|
|
15
|
-
- uses: actions/checkout@
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
16
|
|
|
17
17
|
- name: Use Node.js ${{ matrix.node-version }}
|
|
18
|
-
uses: actions/setup-node@
|
|
18
|
+
uses: actions/setup-node@v4
|
|
19
19
|
with:
|
|
20
20
|
node-version: ${{ matrix.node-version }}
|
|
21
21
|
|
package/dist/TasmotaService.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Characteristic, PlatformAccessory, Service } from 'homebridge';
|
|
2
|
+
import { CustomCharacteristics } from './lib/CustomCharacteristics';
|
|
2
3
|
import { tasmotaPlatform } from './platform';
|
|
3
4
|
interface Subscription {
|
|
4
5
|
event: string;
|
|
@@ -13,14 +14,13 @@ export declare class TasmotaService {
|
|
|
13
14
|
protected device_class: string;
|
|
14
15
|
statusSubscribe: Subscription;
|
|
15
16
|
availabilitySubscribe: Subscription;
|
|
16
|
-
protected CustomCharacteristic: any;
|
|
17
17
|
fakegato: string;
|
|
18
18
|
nunjucksEnvironment: any;
|
|
19
19
|
protected uuid: string;
|
|
20
20
|
constructor(platform: tasmotaPlatform, accessory: PlatformAccessory, uniq_id: string);
|
|
21
21
|
enableFakegato(): void;
|
|
22
22
|
enableStatus(): void;
|
|
23
|
-
deviceClassToHKCharacteristic(device_class: string):
|
|
23
|
+
deviceClassToHKCharacteristic(device_class: string): typeof CustomCharacteristics.Voltage;
|
|
24
24
|
refresh(): void;
|
|
25
25
|
statusUpdate(topic: any, message: any): void;
|
|
26
26
|
availabilityUpdate(topic: any, message: any): void;
|
package/dist/TasmotaService.js
CHANGED
|
@@ -3,21 +3,22 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
|
|
8
|
-
const
|
|
6
|
+
exports.TasmotaService = void 0;
|
|
7
|
+
exports.isTrue = isTrue;
|
|
8
|
+
const node_os_1 = __importDefault(require("node:os"));
|
|
9
9
|
const debug_1 = __importDefault(require("debug"));
|
|
10
|
+
const nunjucks_1 = __importDefault(require("nunjucks"));
|
|
11
|
+
const CustomCharacteristics_1 = require("./lib/CustomCharacteristics");
|
|
10
12
|
const debug = (0, debug_1.default)('Tasmota:Service');
|
|
11
13
|
class TasmotaService {
|
|
12
14
|
constructor(platform, accessory, uniq_id) {
|
|
13
15
|
this.platform = platform;
|
|
14
16
|
this.accessory = accessory;
|
|
15
17
|
this.uniq_id = uniq_id;
|
|
16
|
-
this.CustomCharacteristic = require('./lib/CustomCharacteristics')(platform.Service, platform.Characteristic);
|
|
17
18
|
this.uuid = this.platform.api.hap.uuid.generate(this.accessory.context.device[this.uniq_id].uniq_id);
|
|
18
19
|
this.device_class = accessory.context.device[this.uniq_id].dev_cla;
|
|
19
20
|
this.nunjucksEnvironment = new nunjucks_1.default.Environment();
|
|
20
|
-
this.nunjucksEnvironment.addFilter('is_defined',
|
|
21
|
+
this.nunjucksEnvironment.addFilter('is_defined', (val, cb) => {
|
|
21
22
|
if (val || val === 0) {
|
|
22
23
|
cb(null, val);
|
|
23
24
|
}
|
|
@@ -32,13 +33,14 @@ class TasmotaService {
|
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
enableFakegato() {
|
|
35
|
-
|
|
36
|
-
|
|
36
|
+
var _a, _b;
|
|
37
|
+
if (this.platform.config.history && this.fakegato && !((_a = this.accessory.context.fakegatoService) === null || _a === void 0 ? void 0 : _a.addEntry)) {
|
|
38
|
+
const hostname = node_os_1.default.hostname().split('.')[0];
|
|
37
39
|
this.accessory.context.fakegatoService = new this.platform.FakeGatoHistoryService('custom', this.accessory, {
|
|
38
40
|
storage: 'fs',
|
|
39
|
-
minutes: this.platform.config.historyInterval
|
|
41
|
+
minutes: (_b = this.platform.config.historyInterval) !== null && _b !== void 0 ? _b : 10,
|
|
40
42
|
log: this.platform.log,
|
|
41
|
-
filename: hostname
|
|
43
|
+
filename: `${hostname}_${this.uniq_id}_persist.json`,
|
|
42
44
|
});
|
|
43
45
|
this.platform.log.debug('Creating fakegato service for %s %s', this.accessory.context.device[this.uniq_id].stat_t, this.accessory.context.device[this.uniq_id].name, this.accessory.context.device[this.uniq_id].uniq_id);
|
|
44
46
|
}
|
|
@@ -69,26 +71,27 @@ class TasmotaService {
|
|
|
69
71
|
switch (device_class) {
|
|
70
72
|
case '-dt24-amp':
|
|
71
73
|
case '_energy_current':
|
|
72
|
-
return (
|
|
74
|
+
return (CustomCharacteristics_1.CustomCharacteristics.ElectricCurrent);
|
|
73
75
|
case '_energy_voltage':
|
|
74
76
|
case '-dt24-volt':
|
|
75
|
-
return (
|
|
77
|
+
return (CustomCharacteristics_1.CustomCharacteristics.Voltage);
|
|
76
78
|
case '_energy_power':
|
|
77
79
|
case '-dt24-watt':
|
|
78
|
-
return (
|
|
80
|
+
return (CustomCharacteristics_1.CustomCharacteristics.CurrentConsumption);
|
|
79
81
|
case '_energy_total':
|
|
80
82
|
case '-dt24-watt-hour':
|
|
81
|
-
return (
|
|
83
|
+
return (CustomCharacteristics_1.CustomCharacteristics.TotalConsumption);
|
|
82
84
|
break;
|
|
83
85
|
}
|
|
84
86
|
}
|
|
85
87
|
refresh() {
|
|
86
88
|
if (this.accessory.context.device[this.uniq_id].stat_t && !this.accessory.context.device[this.uniq_id].stat_t.match('/\+|#/g')) {
|
|
87
|
-
const teleperiod = this.accessory.context.device[this.uniq_id].stat_t.substr(0, this.accessory.context.device[this.uniq_id].stat_t.lastIndexOf('/') + 1).replace('tele', 'cmnd')
|
|
89
|
+
const teleperiod = `${this.accessory.context.device[this.uniq_id].stat_t.substr(0, this.accessory.context.device[this.uniq_id].stat_t.lastIndexOf('/') + 1).replace('tele', 'cmnd')}teleperiod`;
|
|
88
90
|
this.accessory.context.mqttHost.sendMessage(teleperiod, this.platform.teleperiod.toString());
|
|
89
91
|
}
|
|
90
92
|
}
|
|
91
93
|
statusUpdate(topic, message) {
|
|
94
|
+
var _a, _b;
|
|
92
95
|
debug('statusUpdate', this.service.displayName, topic, message.toString());
|
|
93
96
|
this.accessory.context.timeout = this.platform.autoCleanup(this.accessory);
|
|
94
97
|
try {
|
|
@@ -114,11 +117,11 @@ class TasmotaService {
|
|
|
114
117
|
if (value instanceof Error) {
|
|
115
118
|
}
|
|
116
119
|
else {
|
|
117
|
-
if (this.characteristic.value
|
|
118
|
-
this.platform.log.info('Updating \'%s:%s\' to %s', this.service.displayName, this.characteristic.displayName
|
|
120
|
+
if (this.characteristic.value !== value && this.delta(this.characteristic.value, value)) {
|
|
121
|
+
this.platform.log.info('Updating \'%s:%s\' to %s', this.service.displayName, (_a = this.characteristic.displayName) !== null && _a !== void 0 ? _a : '', value);
|
|
119
122
|
}
|
|
120
123
|
else {
|
|
121
|
-
this.platform.log.debug('Updating \'%s:%s\' to %s', this.service.displayName, this.characteristic.displayName
|
|
124
|
+
this.platform.log.debug('Updating \'%s:%s\' to %s', this.service.displayName, (_b = this.characteristic.displayName) !== null && _b !== void 0 ? _b : '', value);
|
|
122
125
|
}
|
|
123
126
|
}
|
|
124
127
|
this.characteristic.updateValue(value);
|
|
@@ -130,7 +133,7 @@ class TasmotaService {
|
|
|
130
133
|
availabilityUpdate(topic, message) {
|
|
131
134
|
this.platform.log.info('Marking accessory \'%s\' to %s', this.service.displayName, message);
|
|
132
135
|
if (message.toString() === this.accessory.context.device[this.uniq_id].pl_not_avail) {
|
|
133
|
-
const availability = new Error(this.accessory.displayName
|
|
136
|
+
const availability = new Error(`${this.accessory.displayName} ${message.toString()}`);
|
|
134
137
|
this.characteristic.updateValue(availability);
|
|
135
138
|
}
|
|
136
139
|
else {
|
|
@@ -138,12 +141,12 @@ class TasmotaService {
|
|
|
138
141
|
}
|
|
139
142
|
}
|
|
140
143
|
delta(value1, value2) {
|
|
141
|
-
return (parseInt(value1) !== parseInt(value2));
|
|
144
|
+
return (Number.parseInt(value1) !== Number.parseInt(value2));
|
|
142
145
|
}
|
|
143
146
|
parseValue(valueTemplate, value) {
|
|
144
147
|
try {
|
|
145
148
|
if (valueTemplate) {
|
|
146
|
-
|
|
149
|
+
const template = nunjucks_1.default.compile(valueTemplate, this.nunjucksEnvironment);
|
|
147
150
|
const result = template.render({ value_json: JSON.parse(value) });
|
|
148
151
|
if (result) {
|
|
149
152
|
return result;
|
|
@@ -162,7 +165,7 @@ class TasmotaService {
|
|
|
162
165
|
}
|
|
163
166
|
exports.TasmotaService = TasmotaService;
|
|
164
167
|
function float(val) {
|
|
165
|
-
return (parseFloat(val));
|
|
168
|
+
return (Number.parseFloat(val));
|
|
166
169
|
}
|
|
167
170
|
function isTrue(value) {
|
|
168
171
|
if (typeof (value) === 'string') {
|
|
@@ -170,15 +173,14 @@ function isTrue(value) {
|
|
|
170
173
|
}
|
|
171
174
|
switch (value) {
|
|
172
175
|
case true:
|
|
173
|
-
case
|
|
176
|
+
case 'true':
|
|
174
177
|
case 1:
|
|
175
|
-
case
|
|
176
|
-
case
|
|
177
|
-
case
|
|
178
|
+
case '1':
|
|
179
|
+
case 'on':
|
|
180
|
+
case 'yes':
|
|
178
181
|
return true;
|
|
179
182
|
default:
|
|
180
183
|
return false;
|
|
181
184
|
}
|
|
182
185
|
}
|
|
183
|
-
exports.isTrue = isTrue;
|
|
184
186
|
//# sourceMappingURL=TasmotaService.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TasmotaService.js","sourceRoot":"","sources":["../src/TasmotaService.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"TasmotaService.js","source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IAAI,CAAC;QACV,KAAK,KAAK;YACR,OAAO,IAAI,CAAA;QACb;YACE,OAAO,KAAK,CAAA;IAChB,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const platform_1 = require("./platform");
|
|
4
|
-
|
|
4
|
+
const settings_1 = require("./settings");
|
|
5
|
+
exports.default = (api) => {
|
|
5
6
|
api.registerPlatform(settings_1.PLATFORM_NAME, platform_1.tasmotaPlatform);
|
|
6
7
|
};
|
|
7
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AAEA,yCAA4C;AAC5C,yCAA0C;AAK1C,kBAAe,CAAC,GAAQ,EAAQ,EAAE;IAChC,GAAG,CAAC,gBAAgB,CAAC,wBAAa,EAAE,0BAAe,CAAC,CAAA;AACtD,CAAC,CAAA"}
|
|
@@ -1,2 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
1
|
+
import { Characteristic, Service } from 'hap-nodejs';
|
|
2
|
+
export declare namespace CustomCharacteristics {
|
|
3
|
+
class Voltage extends Characteristic {
|
|
4
|
+
static readonly UUID: string;
|
|
5
|
+
constructor();
|
|
6
|
+
}
|
|
7
|
+
class ElectricCurrent extends Characteristic {
|
|
8
|
+
static readonly UUID: string;
|
|
9
|
+
constructor();
|
|
10
|
+
}
|
|
11
|
+
class CurrentConsumption extends Characteristic {
|
|
12
|
+
static readonly UUID: string;
|
|
13
|
+
constructor();
|
|
14
|
+
}
|
|
15
|
+
class TotalConsumption extends Characteristic {
|
|
16
|
+
static readonly UUID: string;
|
|
17
|
+
constructor();
|
|
18
|
+
}
|
|
19
|
+
class AtmosphericPressureLevel extends Characteristic {
|
|
20
|
+
static readonly UUID: string;
|
|
21
|
+
constructor();
|
|
22
|
+
}
|
|
23
|
+
class ValvePosition extends Characteristic {
|
|
24
|
+
static readonly UUID: string;
|
|
25
|
+
constructor();
|
|
26
|
+
}
|
|
27
|
+
class LastActivation extends Characteristic {
|
|
28
|
+
static readonly UUID: string;
|
|
29
|
+
constructor();
|
|
30
|
+
}
|
|
31
|
+
class ProgramCommand extends Characteristic {
|
|
32
|
+
static readonly UUID: string;
|
|
33
|
+
constructor();
|
|
34
|
+
}
|
|
35
|
+
class TimesOpened extends Characteristic {
|
|
36
|
+
static readonly UUID: string;
|
|
37
|
+
constructor();
|
|
38
|
+
}
|
|
39
|
+
class ResetTotal extends Characteristic {
|
|
40
|
+
static readonly UUID: string;
|
|
41
|
+
constructor();
|
|
42
|
+
}
|
|
43
|
+
class ProgramData extends Characteristic {
|
|
44
|
+
static readonly UUID: string;
|
|
45
|
+
constructor();
|
|
46
|
+
}
|
|
47
|
+
class AtmosphericPressureSensor extends Service {
|
|
48
|
+
static readonly UUID: string;
|
|
49
|
+
constructor(displayName?: string, subtype?: string);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -1,136 +1,166 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
inherits(
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomCharacteristics = void 0;
|
|
4
|
+
const util_1 = require("util");
|
|
5
|
+
const hap_nodejs_1 = require("hap-nodejs");
|
|
6
|
+
var CustomCharacteristics;
|
|
7
|
+
(function (CustomCharacteristics) {
|
|
8
|
+
class Voltage extends hap_nodejs_1.Characteristic {
|
|
9
|
+
constructor() {
|
|
10
|
+
super('Voltage', CustomCharacteristics.Voltage.UUID, {
|
|
11
|
+
format: "float",
|
|
12
|
+
unit: 'V',
|
|
13
|
+
perms: ["pr", "ev"],
|
|
14
|
+
});
|
|
15
|
+
this.value = this.getDefaultValue();
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
Voltage.UUID = 'E863F10A-079E-48FF-8F27-9C2605A29F52';
|
|
19
|
+
CustomCharacteristics.Voltage = Voltage;
|
|
20
|
+
(0, util_1.inherits)(CustomCharacteristics.Voltage, hap_nodejs_1.Characteristic);
|
|
21
|
+
class ElectricCurrent extends hap_nodejs_1.Characteristic {
|
|
22
|
+
constructor() {
|
|
23
|
+
super('Electric Current', CustomCharacteristics.ElectricCurrent.UUID, {
|
|
24
|
+
format: "float",
|
|
25
|
+
unit: 'A',
|
|
26
|
+
perms: ["pr", "ev"],
|
|
27
|
+
});
|
|
28
|
+
this.value = this.getDefaultValue();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
ElectricCurrent.UUID = 'E863F126-079E-48FF-8F27-9C2605A29F52';
|
|
32
|
+
CustomCharacteristics.ElectricCurrent = ElectricCurrent;
|
|
33
|
+
(0, util_1.inherits)(CustomCharacteristics.ElectricCurrent, hap_nodejs_1.Characteristic);
|
|
34
|
+
class CurrentConsumption extends hap_nodejs_1.Characteristic {
|
|
35
|
+
constructor() {
|
|
36
|
+
super('Current Consumption', CustomCharacteristics.CurrentConsumption.UUID, {
|
|
37
|
+
format: "float",
|
|
38
|
+
unit: 'W',
|
|
39
|
+
perms: ["pr", "ev"],
|
|
40
|
+
});
|
|
41
|
+
this.value = this.getDefaultValue();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
CurrentConsumption.UUID = 'E863F10D-079E-48FF-8F27-9C2605A29F52';
|
|
45
|
+
CustomCharacteristics.CurrentConsumption = CurrentConsumption;
|
|
46
|
+
(0, util_1.inherits)(CustomCharacteristics.CurrentConsumption, hap_nodejs_1.Characteristic);
|
|
47
|
+
class TotalConsumption extends hap_nodejs_1.Characteristic {
|
|
48
|
+
constructor() {
|
|
49
|
+
super('Total Consumption', CustomCharacteristics.TotalConsumption.UUID, {
|
|
50
|
+
format: "float",
|
|
51
|
+
unit: 'kWh',
|
|
52
|
+
perms: ["pr", "ev"],
|
|
53
|
+
});
|
|
54
|
+
this.value = this.getDefaultValue();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
TotalConsumption.UUID = 'E863F10C-079E-48FF-8F27-9C2605A29F52';
|
|
58
|
+
CustomCharacteristics.TotalConsumption = TotalConsumption;
|
|
59
|
+
(0, util_1.inherits)(CustomCharacteristics.TotalConsumption, hap_nodejs_1.Characteristic);
|
|
60
|
+
class AtmosphericPressureLevel extends hap_nodejs_1.Characteristic {
|
|
61
|
+
constructor() {
|
|
62
|
+
super('Air Pressure', CustomCharacteristics.AtmosphericPressureLevel.UUID, {
|
|
63
|
+
format: "uint16",
|
|
64
|
+
unit: 'hPa',
|
|
65
|
+
minValue: 100,
|
|
66
|
+
maxValue: 1100,
|
|
67
|
+
minStep: 1,
|
|
68
|
+
perms: ["pr", "ev"],
|
|
69
|
+
});
|
|
70
|
+
this.value = this.getDefaultValue();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
AtmosphericPressureLevel.UUID = 'E863F10F-079E-48FF-8F27-9C2605A29F52';
|
|
74
|
+
CustomCharacteristics.AtmosphericPressureLevel = AtmosphericPressureLevel;
|
|
75
|
+
(0, util_1.inherits)(CustomCharacteristics.AtmosphericPressureLevel, hap_nodejs_1.Characteristic);
|
|
76
|
+
class ValvePosition extends hap_nodejs_1.Characteristic {
|
|
77
|
+
constructor() {
|
|
78
|
+
super('Valve Position', CustomCharacteristics.ValvePosition.UUID, {
|
|
79
|
+
format: "uint8",
|
|
80
|
+
unit: "percentage",
|
|
81
|
+
perms: ["pr", "ev"],
|
|
82
|
+
});
|
|
83
|
+
this.value = this.getDefaultValue();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
ValvePosition.UUID = 'E863F12E-079E-48FF-8F27-9C2605A29F52';
|
|
87
|
+
CustomCharacteristics.ValvePosition = ValvePosition;
|
|
88
|
+
(0, util_1.inherits)(CustomCharacteristics.ValvePosition, hap_nodejs_1.Characteristic);
|
|
89
|
+
class LastActivation extends hap_nodejs_1.Characteristic {
|
|
90
|
+
constructor() {
|
|
91
|
+
super('Last Activation', CustomCharacteristics.LastActivation.UUID, {
|
|
92
|
+
format: "uint32",
|
|
93
|
+
unit: "seconds",
|
|
94
|
+
perms: ["pr", "ev"],
|
|
95
|
+
});
|
|
96
|
+
this.value = this.getDefaultValue();
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
LastActivation.UUID = 'E863F11A-079E-48FF-8F27-9C2605A29F52';
|
|
100
|
+
CustomCharacteristics.LastActivation = LastActivation;
|
|
101
|
+
(0, util_1.inherits)(CustomCharacteristics.LastActivation, hap_nodejs_1.Characteristic);
|
|
102
|
+
class ProgramCommand extends hap_nodejs_1.Characteristic {
|
|
103
|
+
constructor() {
|
|
104
|
+
super('Program Command', CustomCharacteristics.ProgramCommand.UUID, {
|
|
105
|
+
format: "data",
|
|
106
|
+
perms: ["pw", "ev"],
|
|
107
|
+
});
|
|
108
|
+
this.value = this.getDefaultValue();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
ProgramCommand.UUID = 'E863F12C-079E-48FF-8F27-9C2605A29F52';
|
|
112
|
+
CustomCharacteristics.ProgramCommand = ProgramCommand;
|
|
113
|
+
(0, util_1.inherits)(CustomCharacteristics.ProgramCommand, hap_nodejs_1.Characteristic);
|
|
114
|
+
class TimesOpened extends hap_nodejs_1.Characteristic {
|
|
115
|
+
constructor() {
|
|
116
|
+
super('Times Opened', CustomCharacteristics.TimesOpened.UUID, {
|
|
117
|
+
format: "uint32",
|
|
118
|
+
perms: ["pr", "ev"],
|
|
119
|
+
});
|
|
120
|
+
this.value = this.getDefaultValue();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
TimesOpened.UUID = 'E863F129-079E-48FF-8F27-9C2605A29F52';
|
|
124
|
+
CustomCharacteristics.TimesOpened = TimesOpened;
|
|
125
|
+
(0, util_1.inherits)(CustomCharacteristics.TimesOpened, hap_nodejs_1.Characteristic);
|
|
126
|
+
class ResetTotal extends hap_nodejs_1.Characteristic {
|
|
127
|
+
constructor() {
|
|
128
|
+
super('Reset Total', CustomCharacteristics.ResetTotal.UUID, {
|
|
129
|
+
format: "uint32",
|
|
130
|
+
unit: "seconds",
|
|
131
|
+
perms: ["pr", "ev"],
|
|
132
|
+
});
|
|
133
|
+
this.value = this.getDefaultValue();
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
ResetTotal.UUID = 'E863F112-079E-48FF-8F27-9C2605A29F52';
|
|
137
|
+
CustomCharacteristics.ResetTotal = ResetTotal;
|
|
138
|
+
(0, util_1.inherits)(CustomCharacteristics.ResetTotal, hap_nodejs_1.Characteristic);
|
|
139
|
+
class ProgramData extends hap_nodejs_1.Characteristic {
|
|
140
|
+
constructor() {
|
|
141
|
+
super('Program Data', CustomCharacteristics.ProgramData.UUID, {
|
|
142
|
+
format: "data",
|
|
143
|
+
perms: ["pw", "ev"],
|
|
144
|
+
});
|
|
145
|
+
this.value = this.getDefaultValue();
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
ProgramData.UUID = 'E863F12F-079E-48FF-8F27-9C2605A29F52';
|
|
149
|
+
CustomCharacteristics.ProgramData = ProgramData;
|
|
150
|
+
(0, util_1.inherits)(CustomCharacteristics.ProgramData, hap_nodejs_1.Characteristic);
|
|
151
|
+
class AtmosphericPressureSensor extends hap_nodejs_1.Service {
|
|
152
|
+
constructor(displayName, subtype) {
|
|
153
|
+
super(displayName, AtmosphericPressureSensor.UUID, subtype);
|
|
154
|
+
this.addCharacteristic(CustomCharacteristics.AtmosphericPressureLevel);
|
|
155
|
+
this.addOptionalCharacteristic(hap_nodejs_1.Characteristic.StatusActive);
|
|
156
|
+
this.addOptionalCharacteristic(hap_nodejs_1.Characteristic.StatusFault);
|
|
157
|
+
this.addOptionalCharacteristic(hap_nodejs_1.Characteristic.StatusLowBattery);
|
|
158
|
+
this.addOptionalCharacteristic(hap_nodejs_1.Characteristic.StatusTampered);
|
|
159
|
+
this.addOptionalCharacteristic(hap_nodejs_1.Characteristic.Name);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
AtmosphericPressureSensor.UUID = 'B77831FD-D66A-46A4-B66D-FD7EE8DFE3CE';
|
|
163
|
+
CustomCharacteristics.AtmosphericPressureSensor = AtmosphericPressureSensor;
|
|
164
|
+
(0, util_1.inherits)(CustomCharacteristics.AtmosphericPressureSensor, hap_nodejs_1.Service);
|
|
165
|
+
})(CustomCharacteristics || (exports.CustomCharacteristics = CustomCharacteristics = {}));
|
|
136
166
|
//# sourceMappingURL=CustomCharacteristics.js.map
|