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.
Files changed (42) hide show
  1. package/.github/workflows/build.yml +3 -3
  2. package/dist/TasmotaService.d.ts +3 -3
  3. package/dist/TasmotaService.js +28 -26
  4. package/dist/TasmotaService.js.map +1 -1
  5. package/dist/index.d.ts +1 -1
  6. package/dist/index.js +3 -2
  7. package/dist/index.js.map +1 -1
  8. package/dist/lib/CustomCharacteristics.d.ts +51 -2
  9. package/dist/lib/CustomCharacteristics.js +165 -135
  10. package/dist/lib/CustomCharacteristics.js.map +1 -1
  11. package/dist/lib/CustomCharacteristics.spec.d.ts +1 -0
  12. package/dist/lib/CustomCharacteristics.spec.js +136 -0
  13. package/dist/lib/CustomCharacteristics.spec.js.map +1 -0
  14. package/dist/lib/Mqtt.d.ts +0 -1
  15. package/dist/lib/Mqtt.js.map +1 -1
  16. package/dist/lib/testUtils.d.ts +1 -0
  17. package/dist/lib/testUtils.js +18 -0
  18. package/dist/lib/testUtils.js.map +1 -0
  19. package/dist/platform.d.ts +4 -5
  20. package/dist/platform.js +56 -67
  21. package/dist/platform.js.map +1 -1
  22. package/dist/settings.js.map +1 -1
  23. package/dist/tasmotaBinarySensorService.d.ts +1 -1
  24. package/dist/tasmotaBinarySensorService.js +23 -21
  25. package/dist/tasmotaBinarySensorService.js.map +1 -1
  26. package/dist/tasmotaFanService.d.ts +2 -2
  27. package/dist/tasmotaFanService.js +17 -15
  28. package/dist/tasmotaFanService.js.map +1 -1
  29. package/dist/tasmotaGarageService.d.ts +2 -2
  30. package/dist/tasmotaGarageService.js +1 -1
  31. package/dist/tasmotaGarageService.js.map +1 -1
  32. package/dist/tasmotaLightService.d.ts +2 -2
  33. package/dist/tasmotaLightService.js +74 -70
  34. package/dist/tasmotaLightService.js.map +1 -1
  35. package/dist/tasmotaSensorService.js +47 -51
  36. package/dist/tasmotaSensorService.js.map +1 -1
  37. package/dist/tasmotaSwitchService.d.ts +2 -2
  38. package/dist/tasmotaSwitchService.js +12 -8
  39. package/dist/tasmotaSwitchService.js.map +1 -1
  40. package/eslint.config.js +31 -0
  41. package/notes.MD +1 -0
  42. 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: [10.x, 12.x, 13.x]
12
+ node-version: [lts/*, latest]
13
13
 
14
14
  steps:
15
- - uses: actions/checkout@v2
15
+ - uses: actions/checkout@v4
16
16
 
17
17
  - name: Use Node.js ${{ matrix.node-version }}
18
- uses: actions/setup-node@v1
18
+ uses: actions/setup-node@v4
19
19
  with:
20
20
  node-version: ${{ matrix.node-version }}
21
21
 
@@ -1,4 +1,5 @@
1
- import { Service, PlatformAccessory, Characteristic } from 'homebridge';
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): any;
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;
@@ -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.isTrue = exports.TasmotaService = void 0;
7
- const nunjucks_1 = __importDefault(require("nunjucks"));
8
- const os_1 = __importDefault(require("os"));
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', function (val, cb) {
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
- if (this.platform.config.history && this.fakegato && !this.accessory.context.fakegatoService?.addEntry) {
36
- var hostname = os_1.default.hostname().split(".")[0];
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 ?? 10,
41
+ minutes: (_b = this.platform.config.historyInterval) !== null && _b !== void 0 ? _b : 10,
40
42
  log: this.platform.log,
41
- filename: hostname + "_" + this.uniq_id + '_persist.json',
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 (this.CustomCharacteristic.ElectricCurrent);
74
+ return (CustomCharacteristics_1.CustomCharacteristics.ElectricCurrent);
73
75
  case '_energy_voltage':
74
76
  case '-dt24-volt':
75
- return (this.CustomCharacteristic.Voltage);
77
+ return (CustomCharacteristics_1.CustomCharacteristics.Voltage);
76
78
  case '_energy_power':
77
79
  case '-dt24-watt':
78
- return (this.CustomCharacteristic.CurrentConsumption);
80
+ return (CustomCharacteristics_1.CustomCharacteristics.CurrentConsumption);
79
81
  case '_energy_total':
80
82
  case '-dt24-watt-hour':
81
- return (this.CustomCharacteristic.TotalConsumption);
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') + 'teleperiod';
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 != value && this.delta(this.characteristic.value, value)) {
118
- this.platform.log.info('Updating \'%s:%s\' to %s', this.service.displayName, this.characteristic.displayName ?? '', value);
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 ?? '', value);
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 + ' ' + message.toString());
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
- var template = nunjucks_1.default.compile(valueTemplate, this.nunjucksEnvironment);
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 "true":
176
+ case 'true':
174
177
  case 1:
175
- case "1":
176
- case "on":
177
- case "yes":
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":";;;;;;AAEA,wDAAgC;AAChC,4CAAoB;AAEpB,kDAAgC;AAEhC,MAAM,KAAK,GAAG,IAAA,eAAW,EAAC,iBAAiB,CAAC,CAAC;AAY7C,MAAa,cAAc;IAWzB,YACkB,QAAyB,EACzB,SAA4B,EACzB,OAAe;QAFlB,aAAQ,GAAR,QAAQ,CAAiB;QACzB,cAAS,GAAT,SAAS,CAAmB;QACzB,YAAO,GAAP,OAAO,CAAQ;QAGlC,IAAI,CAAC,oBAAoB,GAAG,OAAO,CAAC,6BAA6B,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;QAC9G,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,CAAC;QACrG,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;QAEnE,IAAI,CAAC,mBAAmB,GAAG,IAAI,kBAAQ,CAAC,WAAW,EAAE,CAAC;QAIt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AO,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
@@ -1,3 +1,3 @@
1
1
  import { API } from 'homebridge';
2
2
  declare const _default: (api: API) => void;
3
- export = _default;
3
+ export default _default;
package/dist/index.js CHANGED
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
- const settings_1 = require("./settings");
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const platform_1 = require("./platform");
4
- module.exports = (api) => {
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":";AAEA,yCAA2C;AAC3C,yCAA6C;AAK7C,iBAAS,CAAC,GAAQ,EAAE,EAAE;IACpB,GAAG,CAAC,gBAAgB,CAAC,wBAAa,EAAE,0BAAe,CAAC,CAAC;AACvD,CAAC,CAAA"}
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
- declare const inherits: any;
2
- declare let Service: any, Characteristic: any;
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
- const inherits = require('util').inherits;
2
- let Service, Characteristic;
3
- module.exports = function (Service, Characteristic) {
4
- const CustomCharacteristic = {};
5
- CustomCharacteristic.Voltage = function () {
6
- Characteristic.call(this, 'Voltage', CustomCharacteristic.Voltage.UUID);
7
- this.setProps({
8
- format: Characteristic.Formats.FLOAT,
9
- unit: 'V',
10
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY],
11
- });
12
- this.value = this.getDefaultValue();
13
- };
14
- CustomCharacteristic.Voltage.UUID = 'E863F10A-079E-48FF-8F27-9C2605A29F52';
15
- inherits(CustomCharacteristic.Voltage, Characteristic);
16
- CustomCharacteristic.ElectricCurrent = function () {
17
- Characteristic.call(this, 'Electric Current', CustomCharacteristic.ElectricCurrent.UUID);
18
- this.setProps({
19
- format: Characteristic.Formats.FLOAT,
20
- unit: 'A',
21
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY],
22
- });
23
- this.value = this.getDefaultValue();
24
- };
25
- CustomCharacteristic.ElectricCurrent.UUID = 'E863F126-079E-48FF-8F27-9C2605A29F52';
26
- inherits(CustomCharacteristic.ElectricCurrent, Characteristic);
27
- CustomCharacteristic.CurrentConsumption = function () {
28
- Characteristic.call(this, 'Current Consumption', CustomCharacteristic.CurrentConsumption.UUID);
29
- this.setProps({
30
- format: Characteristic.Formats.FLOAT,
31
- unit: 'W',
32
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY],
33
- });
34
- this.value = this.getDefaultValue();
35
- };
36
- CustomCharacteristic.CurrentConsumption.UUID = 'E863F10D-079E-48FF-8F27-9C2605A29F52';
37
- inherits(CustomCharacteristic.CurrentConsumption, Characteristic);
38
- CustomCharacteristic.TotalConsumption = function () {
39
- Characteristic.call(this, 'Total Consumption', CustomCharacteristic.TotalConsumption.UUID);
40
- this.setProps({
41
- format: Characteristic.Formats.FLOAT,
42
- unit: 'kWh',
43
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY],
44
- });
45
- this.value = this.getDefaultValue();
46
- };
47
- CustomCharacteristic.TotalConsumption.UUID = 'E863F10C-079E-48FF-8F27-9C2605A29F52';
48
- inherits(CustomCharacteristic.TotalConsumption, Characteristic);
49
- CustomCharacteristic.AtmosphericPressureLevel = function () {
50
- Characteristic.call(this, 'Air Pressure', CustomCharacteristic.AtmosphericPressureLevel.UUID);
51
- this.setProps({
52
- format: Characteristic.Formats.UINT16,
53
- unit: 'hPa',
54
- minValue: 100,
55
- maxValue: 1100,
56
- minStep: 1,
57
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY],
58
- });
59
- this.value = this.getDefaultValue();
60
- };
61
- CustomCharacteristic.AtmosphericPressureLevel.UUID = 'E863F10F-079E-48FF-8F27-9C2605A29F52';
62
- inherits(CustomCharacteristic.AtmosphericPressureLevel, Characteristic);
63
- CustomCharacteristic.AtmosphericPressureSensor = function (displayName, subtype) {
64
- Service.call(this, displayName, CustomCharacteristic.AtmosphericPressureSensor.UUID, subtype);
65
- this.addCharacteristic(CustomCharacteristic.AtmosphericPressureLevel);
66
- this.addOptionalCharacteristic(Characteristic.StatusActive);
67
- this.addOptionalCharacteristic(Characteristic.StatusFault);
68
- this.addOptionalCharacteristic(Characteristic.StatusLowBattery);
69
- this.addOptionalCharacteristic(Characteristic.StatusTampered);
70
- this.addOptionalCharacteristic(Characteristic.Name);
71
- };
72
- CustomCharacteristic.AtmosphericPressureSensor.UUID = 'B77831FD-D66A-46A4-B66D-FD7EE8DFE3CE';
73
- inherits(CustomCharacteristic.AtmosphericPressureSensor, Service);
74
- CustomCharacteristic.ValvePosition = function () {
75
- Characteristic.call(this, 'Valve position', 'E863F12E-079E-48FF-8F27-9C2605A29F52');
76
- this.setProps({
77
- format: Characteristic.Formats.UINT8,
78
- unit: Characteristic.Units.PERCENTAGE,
79
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY],
80
- });
81
- this.value = this.getDefaultValue();
82
- };
83
- inherits(CustomCharacteristic.ValvePosition, Characteristic);
84
- CustomCharacteristic.ProgramCommand = function () {
85
- Characteristic.call(this, 'Program command', 'E863F12C-079E-48FF-8F27-9C2605A29F52');
86
- this.setProps({
87
- format: Characteristic.Formats.DATA,
88
- perms: [Characteristic.Perms.WRITE, Characteristic.Perms.NOTIFY],
89
- });
90
- this.value = this.getDefaultValue();
91
- };
92
- inherits(CustomCharacteristic.ProgramCommand, Characteristic);
93
- CustomCharacteristic.ProgramData = function () {
94
- Characteristic.call(this, 'Program data', 'E863F12F-079E-48FF-8F27-9C2605A29F52');
95
- this.setProps({
96
- format: Characteristic.Formats.DATA,
97
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY],
98
- });
99
- this.value = this.getDefaultValue();
100
- };
101
- inherits(CustomCharacteristic.ProgramData, Characteristic);
102
- CustomCharacteristic.LastActivation = function () {
103
- Characteristic.call(this, 'Last Activation', CustomCharacteristic.LastActivation.UUID);
104
- this.setProps({
105
- format: Characteristic.Formats.UINT32,
106
- unit: Characteristic.Units.SECONDS,
107
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY],
108
- });
109
- this.value = this.getDefaultValue();
110
- };
111
- CustomCharacteristic.LastActivation.UUID = 'E863F11A-079E-48FF-8F27-9C2605A29F52';
112
- inherits(CustomCharacteristic.LastActivation, Characteristic);
113
- CustomCharacteristic.ResetTotal = function () {
114
- Characteristic.call(this, 'Reset Total', CustomCharacteristic.ResetTotal.UUID);
115
- this.setProps({
116
- format: Characteristic.Formats.UINT32,
117
- unit: Characteristic.Units.SECONDS,
118
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY],
119
- });
120
- this.value = this.getDefaultValue();
121
- };
122
- CustomCharacteristic.ResetTotal.UUID = 'E863F112-079E-48FF-8F27-9C2605A29F52';
123
- inherits(CustomCharacteristic.LastActivation, Characteristic);
124
- CustomCharacteristic.TimesOpened = function () {
125
- Characteristic.call(this, 'Times Opened', CustomCharacteristic.TimesOpened.UUID);
126
- this.setProps({
127
- format: Characteristic.Formats.UINT32,
128
- perms: [Characteristic.Perms.READ, Characteristic.Perms.NOTIFY],
129
- });
130
- this.value = this.getDefaultValue();
131
- };
132
- CustomCharacteristic.TimesOpened.UUID = 'E863F129-079E-48FF-8F27-9C2605A29F52';
133
- inherits(CustomCharacteristic.TimesOpened, Characteristic);
134
- return CustomCharacteristic;
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