homebridge-tasmota 0.2.0-beta.1 → 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/CHANGELOG.md +9 -0
- package/config.schema.json +1 -1
- package/dist/TasmotaService.d.ts +3 -13
- package/dist/TasmotaService.js +28 -51
- package/dist/TasmotaService.js.map +1 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/CustomCharacteristics.d.ts +51 -3
- package/dist/lib/CustomCharacteristics.js +164 -141
- 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 -2
- package/dist/lib/Mqtt.js +0 -40
- 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 -15
- package/dist/platform.js +63 -169
- package/dist/platform.js.map +1 -1
- package/dist/settings.d.ts +0 -7
- package/dist/settings.js +0 -6
- package/dist/settings.js.map +1 -1
- package/dist/tasmotaBinarySensorService.d.ts +1 -7
- package/dist/tasmotaBinarySensorService.js +21 -39
- package/dist/tasmotaBinarySensorService.js.map +1 -1
- package/dist/tasmotaFanService.d.ts +2 -12
- package/dist/tasmotaFanService.js +22 -43
- package/dist/tasmotaFanService.js.map +1 -1
- package/dist/tasmotaGarageService.d.ts +2 -37
- package/dist/tasmotaGarageService.js +3 -61
- package/dist/tasmotaGarageService.js.map +1 -1
- package/dist/tasmotaLightService.d.ts +2 -12
- package/dist/tasmotaLightService.js +78 -203
- package/dist/tasmotaLightService.js.map +1 -1
- package/dist/tasmotaSensorService.d.ts +0 -6
- package/dist/tasmotaSensorService.js +48 -205
- package/dist/tasmotaSensorService.js.map +1 -1
- package/dist/tasmotaSwitchService.d.ts +2 -16
- package/dist/tasmotaSwitchService.js +9 -98
- package/dist/tasmotaSwitchService.js.map +1 -1
- package/eslint.config.js +31 -0
- package/hbconfig/config.json +80 -77
- package/notes.MD +1 -0
- package/package.json +49 -20
- package/dist/TasmotaService.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/lib/CustomCharacteristics.d.ts.map +0 -1
- package/dist/lib/Mqtt.d.ts.map +0 -1
- package/dist/platform.d.ts.map +0 -1
- package/dist/settings.d.ts.map +0 -1
- package/dist/tasmotaBinarySensorService.d.ts.map +0 -1
- package/dist/tasmotaFanService.d.ts.map +0 -1
- package/dist/tasmotaGarageService.d.ts.map +0 -1
- package/dist/tasmotaLightService.d.ts.map +0 -1
- package/dist/tasmotaSensorService.d.ts.map +0 -1
- package/dist/tasmotaSwitchService.d.ts.map +0 -1
|
@@ -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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. This project uses [Semantic Versioning](https://semver.org/).
|
|
4
4
|
|
|
5
|
+
## 0.2.0 (2024-10-10)
|
|
6
|
+
|
|
7
|
+
## [Version 0.1.12](https://github.com/northernman54/homebridge-tasmota/compare/v0.1.18...v0.1.12)
|
|
8
|
+
|
|
9
|
+
#### Changes
|
|
10
|
+
|
|
11
|
+
- Support for homebridge 2.0
|
|
12
|
+
- Minor exception fixes
|
|
13
|
+
|
|
5
14
|
## 0.1.18 (2024-06-09)
|
|
6
15
|
|
|
7
16
|
## [Version 0.1.18](https://github.com/northernman54/homebridge-tasmota/compare/v0.1.16...v0.1.18)
|
package/config.schema.json
CHANGED
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"type": "number",
|
|
41
41
|
"required": false,
|
|
42
42
|
"placeholder": 24,
|
|
43
|
-
"description": "Cleanup of devices no longer connected too or responding on the network. Time is in hours, defaults to 1 Day."
|
|
43
|
+
"description": "Cleanup of devices no longer connected too or responding on the network. Time is in hours, defaults to 1 Day. Maximum value is 596 hours ( 24 days )."
|
|
44
44
|
},
|
|
45
45
|
"debug": {
|
|
46
46
|
"title": "Debug Logging",
|
package/dist/TasmotaService.d.ts
CHANGED
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Characteristic, PlatformAccessory, Service } from 'homebridge';
|
|
2
|
+
import { CustomCharacteristics } from './lib/CustomCharacteristics';
|
|
2
3
|
import { tasmotaPlatform } from './platform';
|
|
3
|
-
/**
|
|
4
|
-
* Platform Accessory
|
|
5
|
-
* An instance of this class is created for each accessory your platform registers
|
|
6
|
-
* Each accessory may expose multiple services of different service types.
|
|
7
|
-
*/
|
|
8
4
|
interface Subscription {
|
|
9
5
|
event: string;
|
|
10
6
|
callback: any;
|
|
@@ -18,24 +14,18 @@ export declare class TasmotaService {
|
|
|
18
14
|
protected device_class: string;
|
|
19
15
|
statusSubscribe: Subscription;
|
|
20
16
|
availabilitySubscribe: Subscription;
|
|
21
|
-
protected CustomCharacteristic: any;
|
|
22
17
|
fakegato: string;
|
|
23
18
|
nunjucksEnvironment: any;
|
|
24
19
|
protected uuid: string;
|
|
25
20
|
constructor(platform: tasmotaPlatform, accessory: PlatformAccessory, uniq_id: string);
|
|
26
21
|
enableFakegato(): void;
|
|
27
22
|
enableStatus(): void;
|
|
28
|
-
deviceClassToHKCharacteristic(device_class: string):
|
|
23
|
+
deviceClassToHKCharacteristic(device_class: string): typeof CustomCharacteristics.Voltage;
|
|
29
24
|
refresh(): void;
|
|
30
25
|
statusUpdate(topic: any, message: any): void;
|
|
31
|
-
/**
|
|
32
|
-
* Handle "LWT" Last Will and Testament messages from Tasmota
|
|
33
|
-
* These are sent when the device is no longer available from the MQTT server.
|
|
34
|
-
*/
|
|
35
26
|
availabilityUpdate(topic: any, message: any): void;
|
|
36
27
|
delta(value1: any, value2: any): boolean;
|
|
37
28
|
parseValue(valueTemplate: string, value: string): any;
|
|
38
29
|
}
|
|
39
30
|
export declare function isTrue(value: string | boolean | number): boolean;
|
|
40
31
|
export {};
|
|
41
|
-
//# sourceMappingURL=TasmotaService.d.ts.map
|
package/dist/TasmotaService.js
CHANGED
|
@@ -3,24 +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
|
-
/* eslint-disable */
|
|
17
|
-
this.CustomCharacteristic = require('./lib/CustomCharacteristics')(platform.Service, platform.Characteristic);
|
|
18
18
|
this.uuid = this.platform.api.hap.uuid.generate(this.accessory.context.device[this.uniq_id].uniq_id);
|
|
19
19
|
this.device_class = accessory.context.device[this.uniq_id].dev_cla;
|
|
20
20
|
this.nunjucksEnvironment = new nunjucks_1.default.Environment();
|
|
21
|
-
|
|
22
|
-
this.nunjucksEnvironment.addFilter('is_defined', function (val, cb) {
|
|
23
|
-
// console.log('is_defined', val, cb);
|
|
21
|
+
this.nunjucksEnvironment.addFilter('is_defined', (val, cb) => {
|
|
24
22
|
if (val || val === 0) {
|
|
25
23
|
cb(null, val);
|
|
26
24
|
}
|
|
@@ -35,15 +33,14 @@ class TasmotaService {
|
|
|
35
33
|
});
|
|
36
34
|
}
|
|
37
35
|
enableFakegato() {
|
|
38
|
-
// Enable historical logging
|
|
39
36
|
var _a, _b;
|
|
40
37
|
if (this.platform.config.history && this.fakegato && !((_a = this.accessory.context.fakegatoService) === null || _a === void 0 ? void 0 : _a.addEntry)) {
|
|
41
|
-
|
|
38
|
+
const hostname = node_os_1.default.hostname().split('.')[0];
|
|
42
39
|
this.accessory.context.fakegatoService = new this.platform.FakeGatoHistoryService('custom', this.accessory, {
|
|
43
40
|
storage: 'fs',
|
|
44
41
|
minutes: (_b = this.platform.config.historyInterval) !== null && _b !== void 0 ? _b : 10,
|
|
45
42
|
log: this.platform.log,
|
|
46
|
-
filename: hostname
|
|
43
|
+
filename: `${hostname}_${this.uniq_id}_persist.json`,
|
|
47
44
|
});
|
|
48
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);
|
|
49
46
|
}
|
|
@@ -73,25 +70,23 @@ class TasmotaService {
|
|
|
73
70
|
deviceClassToHKCharacteristic(device_class) {
|
|
74
71
|
switch (device_class) {
|
|
75
72
|
case '-dt24-amp':
|
|
76
|
-
case '_energy_current':
|
|
77
|
-
return (
|
|
78
|
-
case '_energy_voltage':
|
|
79
|
-
case '-dt24-volt':
|
|
80
|
-
return (
|
|
81
|
-
case '_energy_power':
|
|
82
|
-
case '-dt24-watt':
|
|
83
|
-
return (
|
|
84
|
-
case '_energy_total':
|
|
73
|
+
case '_energy_current':
|
|
74
|
+
return (CustomCharacteristics_1.CustomCharacteristics.ElectricCurrent);
|
|
75
|
+
case '_energy_voltage':
|
|
76
|
+
case '-dt24-volt':
|
|
77
|
+
return (CustomCharacteristics_1.CustomCharacteristics.Voltage);
|
|
78
|
+
case '_energy_power':
|
|
79
|
+
case '-dt24-watt':
|
|
80
|
+
return (CustomCharacteristics_1.CustomCharacteristics.CurrentConsumption);
|
|
81
|
+
case '_energy_total':
|
|
85
82
|
case '-dt24-watt-hour':
|
|
86
|
-
return (
|
|
83
|
+
return (CustomCharacteristics_1.CustomCharacteristics.TotalConsumption);
|
|
87
84
|
break;
|
|
88
85
|
}
|
|
89
86
|
}
|
|
90
87
|
refresh() {
|
|
91
|
-
// Get current status for accessory/service on startup
|
|
92
|
-
// Wild cards in topic break this
|
|
93
88
|
if (this.accessory.context.device[this.uniq_id].stat_t && !this.accessory.context.device[this.uniq_id].stat_t.match('/\+|#/g')) {
|
|
94
|
-
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`;
|
|
95
90
|
this.accessory.context.mqttHost.sendMessage(teleperiod, this.platform.teleperiod.toString());
|
|
96
91
|
}
|
|
97
92
|
}
|
|
@@ -101,7 +96,6 @@ class TasmotaService {
|
|
|
101
96
|
this.accessory.context.timeout = this.platform.autoCleanup(this.accessory);
|
|
102
97
|
try {
|
|
103
98
|
let value = this.parseValue(this.accessory.context.device[this.uniq_id].val_tpl, message.toString());
|
|
104
|
-
// Sensor value tweaks or adjustments needed for homekit
|
|
105
99
|
switch (this.device_class) {
|
|
106
100
|
case 'temperature':
|
|
107
101
|
if (this.accessory.context.device[this.uniq_id].unit_of_meas.toUpperCase() === 'F') {
|
|
@@ -109,7 +103,6 @@ class TasmotaService {
|
|
|
109
103
|
}
|
|
110
104
|
break;
|
|
111
105
|
case 'illuminance':
|
|
112
|
-
// normalize LX in the range homebridge expects
|
|
113
106
|
value = (value < 0.0001 ? 0.0001 : (value > 100000 ? 100000 : value));
|
|
114
107
|
break;
|
|
115
108
|
case 'co2':
|
|
@@ -122,10 +115,9 @@ class TasmotaService {
|
|
|
122
115
|
break;
|
|
123
116
|
}
|
|
124
117
|
if (value instanceof Error) {
|
|
125
|
-
// Error has already been handled
|
|
126
118
|
}
|
|
127
119
|
else {
|
|
128
|
-
if (this.characteristic.value
|
|
120
|
+
if (this.characteristic.value !== value && this.delta(this.characteristic.value, value)) {
|
|
129
121
|
this.platform.log.info('Updating \'%s:%s\' to %s', this.service.displayName, (_a = this.characteristic.displayName) !== null && _a !== void 0 ? _a : '', value);
|
|
130
122
|
}
|
|
131
123
|
else {
|
|
@@ -138,35 +130,24 @@ class TasmotaService {
|
|
|
138
130
|
this.platform.log.error('ERROR: Message Parse Error', topic, message.toString());
|
|
139
131
|
}
|
|
140
132
|
}
|
|
141
|
-
/**
|
|
142
|
-
* Handle "LWT" Last Will and Testament messages from Tasmota
|
|
143
|
-
* These are sent when the device is no longer available from the MQTT server.
|
|
144
|
-
*/
|
|
145
133
|
availabilityUpdate(topic, message) {
|
|
146
|
-
// debug("availabilityUpdate", this, topic, message.toString());
|
|
147
134
|
this.platform.log.info('Marking accessory \'%s\' to %s', this.service.displayName, message);
|
|
148
135
|
if (message.toString() === this.accessory.context.device[this.uniq_id].pl_not_avail) {
|
|
149
|
-
const availability = new Error(this.accessory.displayName
|
|
136
|
+
const availability = new Error(`${this.accessory.displayName} ${message.toString()}`);
|
|
150
137
|
this.characteristic.updateValue(availability);
|
|
151
138
|
}
|
|
152
139
|
else {
|
|
153
|
-
// debug("availabilityUpdate", this.characteristic);
|
|
154
140
|
this.characteristic.updateValue(this.characteristic.value);
|
|
155
141
|
}
|
|
156
142
|
}
|
|
157
|
-
// Utility functions for status update
|
|
158
143
|
delta(value1, value2) {
|
|
159
|
-
|
|
160
|
-
return (parseInt(value1) !== parseInt(value2));
|
|
144
|
+
return (Number.parseInt(value1) !== Number.parseInt(value2));
|
|
161
145
|
}
|
|
162
146
|
parseValue(valueTemplate, value) {
|
|
163
147
|
try {
|
|
164
148
|
if (valueTemplate) {
|
|
165
|
-
|
|
166
|
-
var template = nunjucks_1.default.compile(valueTemplate, this.nunjucksEnvironment);
|
|
167
|
-
// debug('nunjucksEnvironment', template, this.nunjucksEnvironment, value);
|
|
149
|
+
const template = nunjucks_1.default.compile(valueTemplate, this.nunjucksEnvironment);
|
|
168
150
|
const result = template.render({ value_json: JSON.parse(value) });
|
|
169
|
-
// debug('nunjucksEnvironment-result', valueTemplate, value, result);
|
|
170
151
|
if (result) {
|
|
171
152
|
return result;
|
|
172
153
|
}
|
|
@@ -179,15 +160,12 @@ class TasmotaService {
|
|
|
179
160
|
}
|
|
180
161
|
}
|
|
181
162
|
catch (err) {
|
|
182
|
-
// this.platform.log.error('ERROR: Template Parsing error', err.message);
|
|
183
|
-
// debug('ERROR: Template Parsing error', valueTemplate, value);
|
|
184
|
-
// return (err);
|
|
185
163
|
}
|
|
186
164
|
}
|
|
187
165
|
}
|
|
188
166
|
exports.TasmotaService = TasmotaService;
|
|
189
167
|
function float(val) {
|
|
190
|
-
return (parseFloat(val));
|
|
168
|
+
return (Number.parseFloat(val));
|
|
191
169
|
}
|
|
192
170
|
function isTrue(value) {
|
|
193
171
|
if (typeof (value) === 'string') {
|
|
@@ -195,15 +173,14 @@ function isTrue(value) {
|
|
|
195
173
|
}
|
|
196
174
|
switch (value) {
|
|
197
175
|
case true:
|
|
198
|
-
case
|
|
176
|
+
case 'true':
|
|
199
177
|
case 1:
|
|
200
|
-
case
|
|
201
|
-
case
|
|
202
|
-
case
|
|
178
|
+
case '1':
|
|
179
|
+
case 'on':
|
|
180
|
+
case 'yes':
|
|
203
181
|
return true;
|
|
204
182
|
default:
|
|
205
183
|
return false;
|
|
206
184
|
}
|
|
207
185
|
}
|
|
208
|
-
exports.isTrue = isTrue;
|
|
209
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","sourceRoot":"","sources":["../src/TasmotaService.ts"],"names":[],"mappings":";;;;;;AA6NA,wBAeC;AA5OD,sDAAwB;AACxB,kDAA+B;AAE/B,wDAA+B;AAC/B,uEAAmE;AAInE,MAAM,KAAK,GAAG,IAAA,eAAW,EAAC,iBAAiB,CAAC,CAAA;AAa5C,MAAa,cAAc;IAUzB,YACkB,QAAyB,EACzB,SAA4B,EACzB,OAAe;QAFlB,aAAQ,GAAR,QAAQ,CAAiB;QACzB,cAAS,GAAT,SAAS,CAAmB;QACzB,YAAO,GAAP,OAAO,CAAQ;QAElC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAA;QACpG,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAA;QAElE,IAAI,CAAC,mBAAmB,GAAG,IAAI,kBAAQ,CAAC,WAAW,EAAE,CAAA;QAIrD,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,EAAE;YAE3D,IAAI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K,CAAC,GAAG;IAChB,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;AACjC,CAAC;AAED,SAAgB,MAAM,CAAC,KAAgC;IACrD,IAAI,OAAO,CAAC,KAAK,CAAC,KAAK,QAAQ,EAAE,CAAC;QAChC,KAAK,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAA;IACpC,CAAC;IACD,QAAQ,KAAK,EAAE,CAAC;QACd,KAAK,IAAI,CAAC;QACV,KAAK,MAAM,CAAC;QACZ,KAAK,CAAC,CAAC;QACP,KAAK,GAAG,CAAC;QACT,KAAK,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,3 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
declare
|
|
3
|
-
|
|
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
|
+
}
|