homebridge-valor-fireplace 2.0.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.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +94 -0
  3. package/config.schema.json +50 -0
  4. package/dist/controllers/fireplaceController.d.ts +58 -0
  5. package/dist/controllers/fireplaceController.d.ts.map +1 -0
  6. package/dist/controllers/fireplaceController.js +264 -0
  7. package/dist/controllers/fireplaceController.js.map +1 -0
  8. package/dist/controllers/requestController.d.ts +36 -0
  9. package/dist/controllers/requestController.d.ts.map +1 -0
  10. package/dist/controllers/requestController.js +82 -0
  11. package/dist/controllers/requestController.js.map +1 -0
  12. package/dist/controllers/serviceController.d.ts +34 -0
  13. package/dist/controllers/serviceController.d.ts.map +1 -0
  14. package/dist/controllers/serviceController.js +76 -0
  15. package/dist/controllers/serviceController.js.map +1 -0
  16. package/dist/index.d.ts +7 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +7 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/models/auxMode.d.ts +7 -0
  21. package/dist/models/auxMode.d.ts.map +1 -0
  22. package/dist/models/auxMode.js +13 -0
  23. package/dist/models/auxMode.js.map +1 -0
  24. package/dist/models/deviceConfig.d.ts +5 -0
  25. package/dist/models/deviceConfig.d.ts.map +1 -0
  26. package/dist/models/deviceConfig.js +3 -0
  27. package/dist/models/deviceConfig.js.map +1 -0
  28. package/dist/models/fireplaceStatus.d.ts +13 -0
  29. package/dist/models/fireplaceStatus.d.ts.map +1 -0
  30. package/dist/models/fireplaceStatus.js +55 -0
  31. package/dist/models/fireplaceStatus.js.map +1 -0
  32. package/dist/models/flameHeight.d.ts +20 -0
  33. package/dist/models/flameHeight.d.ts.map +1 -0
  34. package/dist/models/flameHeight.js +36 -0
  35. package/dist/models/flameHeight.js.map +1 -0
  36. package/dist/models/operationMode.d.ts +17 -0
  37. package/dist/models/operationMode.d.ts.map +1 -0
  38. package/dist/models/operationMode.js +80 -0
  39. package/dist/models/operationMode.js.map +1 -0
  40. package/dist/models/request.d.ts +9 -0
  41. package/dist/models/request.d.ts.map +1 -0
  42. package/dist/models/request.js +3 -0
  43. package/dist/models/request.js.map +1 -0
  44. package/dist/models/temperatureRange.d.ts +4 -0
  45. package/dist/models/temperatureRange.d.ts.map +1 -0
  46. package/dist/models/temperatureRange.js +23 -0
  47. package/dist/models/temperatureRange.js.map +1 -0
  48. package/dist/platform.d.ts +20 -0
  49. package/dist/platform.d.ts.map +1 -0
  50. package/dist/platform.js +78 -0
  51. package/dist/platform.js.map +1 -0
  52. package/dist/platformAccessory.d.ts +35 -0
  53. package/dist/platformAccessory.d.ts.map +1 -0
  54. package/dist/platformAccessory.js +239 -0
  55. package/dist/platformAccessory.js.map +1 -0
  56. package/dist/settings.d.ts +9 -0
  57. package/dist/settings.d.ts.map +1 -0
  58. package/dist/settings.js +12 -0
  59. package/dist/settings.js.map +1 -0
  60. package/package.json +45 -0
@@ -0,0 +1,34 @@
1
+ import { Characteristic, Logger, PlatformAccessory } from "homebridge";
2
+ import { ValorPlatform } from "../platform";
3
+ export interface IServiceController {
4
+ reachableCharacteristic(): Characteristic;
5
+ activeCharacteristic(): Characteristic;
6
+ currentHeaterCoolerStateCharacteristic(): Characteristic;
7
+ targetHeaterCoolerStateCharacteristic(): Characteristic;
8
+ currentTemperatureCharacteristic(): Characteristic;
9
+ coolingThresholdTemperatureCharacteristic(): Characteristic;
10
+ lockControlsCharacteristic(): Characteristic;
11
+ swingModeCharacteristic(): Characteristic;
12
+ heatingThresholdTemperatureCharacteristic(): Characteristic;
13
+ initCharacteristics(): void;
14
+ }
15
+ export declare class ServiceController implements IServiceController {
16
+ readonly log: Logger;
17
+ readonly accessory: PlatformAccessory;
18
+ private readonly platform;
19
+ private readonly config;
20
+ private readonly service;
21
+ private readonly reachableService;
22
+ constructor(log: Logger, accessory: PlatformAccessory, platform: ValorPlatform);
23
+ initCharacteristics(): void;
24
+ reachableCharacteristic: () => Characteristic;
25
+ activeCharacteristic: () => Characteristic;
26
+ currentHeaterCoolerStateCharacteristic: () => Characteristic;
27
+ targetHeaterCoolerStateCharacteristic: () => Characteristic;
28
+ currentTemperatureCharacteristic: () => Characteristic;
29
+ coolingThresholdTemperatureCharacteristic: () => Characteristic;
30
+ lockControlsCharacteristic: () => Characteristic;
31
+ swingModeCharacteristic: () => Characteristic;
32
+ heatingThresholdTemperatureCharacteristic: () => Characteristic;
33
+ }
34
+ //# sourceMappingURL=serviceController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceController.d.ts","sourceRoot":"","sources":["../../src/controllers/serviceController.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,EAAE,iBAAiB,EAAW,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,WAAW,kBAAkB;IACjC,uBAAuB,IAAI,cAAc,CAAC;IAC1C,oBAAoB,IAAI,cAAc,CAAC;IACvC,sCAAsC,IAAI,cAAc,CAAC;IACzD,qCAAqC,IAAI,cAAc,CAAC;IACxD,gCAAgC,IAAI,cAAc,CAAC;IACnD,yCAAyC,IAAI,cAAc,CAAC;IAC5D,0BAA0B,IAAI,cAAc,CAAC;IAC7C,uBAAuB,IAAI,cAAc,CAAC;IAC1C,yCAAyC,IAAI,cAAc,CAAC;IAC5D,mBAAmB,IAAI,IAAI,CAAC;CAC7B;AAED,qBAAa,iBAAkB,YAAW,kBAAkB;aAMxC,GAAG,EAAE,MAAM;aACX,SAAS,EAAE,iBAAiB;IAC5C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAP3B,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAgB;IACvC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAU;IAClC,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAU;gBAGzB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,aAAa;IAiB1C,mBAAmB;IAkEnB,uBAAuB,uBAGnB;IAEJ,oBAAoB,uBACkD;IAEtE,sCAAsC,uBAGlC;IAEJ,qCAAqC,uBAGjC;IAEJ,gCAAgC,uBAG5B;IAEJ,yCAAyC,uBAGrC;IAEJ,0BAA0B,uBAGtB;IAEJ,uBAAuB,uBACkD;IAEzE,yCAAyC,uBAGrC;CACL"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ServiceController = void 0;
4
+ class ServiceController {
5
+ constructor(log, accessory, platform) {
6
+ this.log = log;
7
+ this.accessory = accessory;
8
+ this.platform = platform;
9
+ this.reachableCharacteristic = () => this.reachableService.getCharacteristic(this.platform.Characteristic.ContactSensorState);
10
+ this.activeCharacteristic = () => this.service.getCharacteristic(this.platform.Characteristic.Active);
11
+ this.currentHeaterCoolerStateCharacteristic = () => this.service.getCharacteristic(this.platform.Characteristic.CurrentHeaterCoolerState);
12
+ this.targetHeaterCoolerStateCharacteristic = () => this.service.getCharacteristic(this.platform.Characteristic.TargetHeaterCoolerState);
13
+ this.currentTemperatureCharacteristic = () => this.service.getCharacteristic(this.platform.Characteristic.CurrentTemperature);
14
+ this.coolingThresholdTemperatureCharacteristic = () => this.service.getCharacteristic(this.platform.Characteristic.CoolingThresholdTemperature);
15
+ this.lockControlsCharacteristic = () => this.service.getCharacteristic(this.platform.Characteristic.LockPhysicalControls);
16
+ this.swingModeCharacteristic = () => this.service.getCharacteristic(this.platform.Characteristic.SwingMode);
17
+ this.heatingThresholdTemperatureCharacteristic = () => this.service.getCharacteristic(this.platform.Characteristic.HeatingThresholdTemperature);
18
+ this.config = this.accessory.context.device;
19
+ // Get or add the HeaterCooler service
20
+ this.service =
21
+ this.accessory.getService(this.platform.Service.HeaterCooler) ||
22
+ this.accessory.addService(this.platform.Service.HeaterCooler);
23
+ // Get or add ContactSensor service
24
+ this.reachableService =
25
+ this.accessory.getService(this.platform.Service.ContactSensor) ||
26
+ this.accessory.addService(this.platform.Service.ContactSensor);
27
+ // Note: Don't call initCharacteristics() here - it will be called after handlers are set up
28
+ }
29
+ initCharacteristics() {
30
+ var _a, _b;
31
+ const name = this.config.name;
32
+ if (name.length < 2) {
33
+ this.platform.log.error(`The given name ${this.config.name}, is too short`);
34
+ throw new this.platform.api.hap.HapStatusError(-70409 /* this.platform.api.hap.HAPStatus.RESOURCE_DOES_NOT_EXIST */);
35
+ }
36
+ this.accessory
37
+ .getService(this.platform.Service.AccessoryInformation)
38
+ .setCharacteristic(this.platform.Characteristic.Manufacturer, "Valor")
39
+ .setCharacteristic(this.platform.Characteristic.Model, "B6R-WME")
40
+ .setCharacteristic(this.platform.Characteristic.SerialNumber, this.accessory.UUID)
41
+ .setCharacteristic(this.platform.Characteristic.Name, (_a = this.config.name) !== null && _a !== void 0 ? _a : "Fireplace");
42
+ // Set the service names
43
+ this.service.setCharacteristic(this.platform.Characteristic.Name, (_b = this.config.name) !== null && _b !== void 0 ? _b : "Fireplace");
44
+ this.reachableService.setCharacteristic(this.platform.Characteristic.Name, "Connected");
45
+ // Configure target heater cooler state to support HEAT (Temperature/Manual) and COOL (Eco)
46
+ // Removed AUTO to avoid confusing "68-68" display
47
+ this.targetHeaterCoolerStateCharacteristic().setProps({
48
+ validValues: [
49
+ this.platform.Characteristic.TargetHeaterCoolerState.HEAT,
50
+ this.platform.Characteristic.TargetHeaterCoolerState.COOL,
51
+ ],
52
+ });
53
+ // Configure HeatingThresholdTemperature with proper props
54
+ // Note: Set minValue to 0 to allow for "off" state where target temp can be 0
55
+ this.heatingThresholdTemperatureCharacteristic().setProps({
56
+ minValue: 0.0,
57
+ maxValue: 36.0,
58
+ minStep: 0.5,
59
+ });
60
+ // Configure CoolingThresholdTemperature - required for iOS to display detail view
61
+ // Even though we don't use cooling, iOS needs this characteristic defined
62
+ this.coolingThresholdTemperatureCharacteristic().setProps({
63
+ minValue: 10.0,
64
+ maxValue: 35.0,
65
+ minStep: 0.5,
66
+ });
67
+ // Configure CurrentTemperature with proper props
68
+ this.currentTemperatureCharacteristic().setProps({
69
+ minValue: 0.0,
70
+ maxValue: 100.0,
71
+ minStep: 0.1,
72
+ });
73
+ }
74
+ }
75
+ exports.ServiceController = ServiceController;
76
+ //# sourceMappingURL=serviceController.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serviceController.js","sourceRoot":"","sources":["../../src/controllers/serviceController.ts"],"names":[],"mappings":";;;AAiBA,MAAa,iBAAiB;IAK5B,YACkB,GAAW,EACX,SAA4B,EAC3B,QAAuB;QAFxB,QAAG,GAAH,GAAG,CAAQ;QACX,cAAS,GAAT,SAAS,CAAmB;QAC3B,aAAQ,GAAR,QAAQ,CAAe;QAmF1C,4BAAuB,GAAG,GAAG,EAAE,CAC7B,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CACrC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,kBAAkB,CAChD,CAAC;QAEJ,yBAAoB,GAAG,GAAG,EAAE,CAC1B,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;QAEtE,2CAAsC,GAAG,GAAG,EAAE,CAC5C,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAC5B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,wBAAwB,CACtD,CAAC;QAEJ,0CAAqC,GAAG,GAAG,EAAE,CAC3C,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAC5B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,uBAAuB,CACrD,CAAC;QAEJ,qCAAgC,GAAG,GAAG,EAAE,CACtC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAC5B,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,kBAAkB,CAChD,CAAC;QAEJ,8CAAyC,GAAG,GAAG,EAAE,CAC/C,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAC5B,IAAI,C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Q,CAAC;YACxD,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,GAAG;SACb,CAAC,CAAC;QAEH,kFAAkF;QAClF,0EAA0E;QAC1E,IAAI,CAAC,yCAAyC,EAAE,CAAC,QAAQ,CAAC;YACxD,QAAQ,EAAE,IAAI;YACd,QAAQ,EAAE,IAAI;YACd,OAAO,EAAE,GAAG;SACb,CAAC,CAAC;QAEH,iDAAiD;QACjD,IAAI,CAAC,gCAAgC,EAAE,CAAC,QAAQ,CAAC;YAC/C,QAAQ,EAAE,GAAG;YACb,QAAQ,EAAE,KAAK;YACf,OAAO,EAAE,GAAG;SACb,CAAC,CAAC;IACL,CAAC;CA0CF;AAnID,8CAmIC"}
@@ -0,0 +1,7 @@
1
+ import { API } from 'homebridge';
2
+ /**
3
+ * This method registers the platform with Homebridge
4
+ */
5
+ declare const _default: (api: API) => void;
6
+ export = _default;
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAKjC;;GAEG;8BACY,GAAG;AAAlB,kBAEE"}
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ const settings_1 = require("./settings");
3
+ const platform_1 = require("./platform");
4
+ module.exports = (api) => {
5
+ api.registerPlatform(settings_1.PLATFORM_NAME, platform_1.ValorPlatform);
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,yCAA2C;AAC3C,yCAA2C;AAK3C,iBAAS,CAAC,GAAQ,EAAE,EAAE;IACpB,GAAG,CAAC,gBAAgB,CAAC,wBAAa,EAAE,wBAAa,CAAC,CAAC;AACrD,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { CharacteristicValue } from 'homebridge';
2
+ import { ValorPlatform } from '../platform';
3
+ export declare class AuxModeUtils {
4
+ static toSwingMode(platform: ValorPlatform, auxOn: boolean): CharacteristicValue;
5
+ static fromSwingMode(platform: ValorPlatform, swingMode: CharacteristicValue): boolean;
6
+ }
7
+ //# sourceMappingURL=auxMode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auxMode.d.ts","sourceRoot":"","sources":["../../src/models/auxMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,qBAAa,YAAY;WACT,WAAW,CAAC,QAAQ,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,GAAG,mBAAmB;WAIzE,aAAa,CAAC,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,mBAAmB,GAAG,OAAO;CAG9F"}
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuxModeUtils = void 0;
4
+ class AuxModeUtils {
5
+ static toSwingMode(platform, auxOn) {
6
+ return auxOn ? platform.Characteristic.SwingMode.SWING_ENABLED : platform.Characteristic.SwingMode.SWING_DISABLED;
7
+ }
8
+ static fromSwingMode(platform, swingMode) {
9
+ return swingMode === platform.Characteristic.SwingMode.SWING_ENABLED;
10
+ }
11
+ }
12
+ exports.AuxModeUtils = AuxModeUtils;
13
+ //# sourceMappingURL=auxMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auxMode.js","sourceRoot":"","sources":["../../src/models/auxMode.ts"],"names":[],"mappings":";;;AAGA,MAAa,YAAY;IAChB,MAAM,CAAC,WAAW,CAAC,QAAuB,EAAE,KAAc;QAC/D,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,cAAc,CAAC;IACpH,CAAC;IAEM,MAAM,CAAC,aAAa,CAAC,QAAuB,EAAE,SAA8B;QACjF,OAAO,SAAS,KAAK,QAAQ,CAAC,cAAc,CAAC,SAAS,CAAC,aAAa,CAAC;IACvE,CAAC;CACF;AARD,oCAQC"}
@@ -0,0 +1,5 @@
1
+ export interface IDeviceConfig {
2
+ name: string;
3
+ ip: string;
4
+ }
5
+ //# sourceMappingURL=deviceConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceConfig.d.ts","sourceRoot":"","sources":["../../src/models/deviceConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=deviceConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deviceConfig.js","sourceRoot":"","sources":["../../src/models/deviceConfig.ts"],"names":[],"mappings":""}
@@ -0,0 +1,13 @@
1
+ import { OperationMode } from './operationMode';
2
+ export declare class FireplaceStatus {
3
+ readonly auxOn: boolean;
4
+ readonly mode: OperationMode;
5
+ readonly currentTemperature: number;
6
+ readonly targetTemperature: number;
7
+ readonly igniting: boolean;
8
+ readonly guardFlameOn: boolean;
9
+ readonly shuttingDown: boolean;
10
+ constructor(status: string);
11
+ toString(): string;
12
+ }
13
+ //# sourceMappingURL=fireplaceStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fireplaceStatus.d.ts","sourceRoot":"","sources":["../../src/models/fireplaceStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,qBAAa,eAAe;IAC1B,SAAgB,KAAK,EAAE,OAAO,CAAS;IACvC,SAAgB,IAAI,EAAE,aAAa,CAAqB;IACxD,SAAgB,kBAAkB,EAAE,MAAM,CAAM;IAChD,SAAgB,iBAAiB,EAAE,MAAM,CAAM;IAC/C,SAAgB,QAAQ,EAAE,OAAO,CAAS;IAC1C,SAAgB,YAAY,EAAE,OAAO,CAAS;IAC9C,SAAgB,YAAY,EAAE,OAAO,CAAS;gBAElC,MAAM,EAAE,MAAM;IAgBnB,QAAQ,IAAI,MAAM;CAS1B"}
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FireplaceStatus = void 0;
4
+ const operationMode_1 = require("./operationMode");
5
+ class FireplaceStatus {
6
+ constructor(status) {
7
+ this.auxOn = false;
8
+ this.mode = operationMode_1.OperationMode.Off;
9
+ this.currentTemperature = 10;
10
+ this.targetTemperature = 10;
11
+ this.igniting = false;
12
+ this.guardFlameOn = false;
13
+ this.shuttingDown = false;
14
+ const modeBits = status.substring(24, 25);
15
+ const statusBits = status.substring(16, 20);
16
+ this.shuttingDown = fromBitStatus(statusBits, 7);
17
+ this.guardFlameOn = fromBitStatus(statusBits, 8);
18
+ this.igniting = fromBitStatus(statusBits, 11);
19
+ this.currentTemperature = parseInt('0x' + status.substring(28, 32)) / 10;
20
+ this.targetTemperature = parseInt('0x' + status.substring(32, 36)) / 10;
21
+ this.auxOn = fromBitStatus(statusBits, 12);
22
+ let opMode = operationModeOfBits(modeBits);
23
+ if (!this.guardFlameOn || this.shuttingDown) {
24
+ opMode = operationMode_1.OperationMode.Off;
25
+ }
26
+ this.mode = opMode;
27
+ }
28
+ toString() {
29
+ return `mode:${operationMode_1.OperationMode[this.mode]} `
30
+ + `ignite:${this.igniting} `
31
+ + `target:${this.targetTemperature} `
32
+ + `aux:${this.auxOn} `
33
+ + `current:${this.currentTemperature} `
34
+ + `shutdown:${this.shuttingDown} `
35
+ + `guardOn:${this.guardFlameOn} `;
36
+ }
37
+ }
38
+ exports.FireplaceStatus = FireplaceStatus;
39
+ function operationModeOfBits(mode) {
40
+ switch (mode) {
41
+ case '1':
42
+ return operationMode_1.OperationMode.Temperature;
43
+ case '2':
44
+ return operationMode_1.OperationMode.Eco;
45
+ default:
46
+ return operationMode_1.OperationMode.Manual;
47
+ }
48
+ }
49
+ function hex2bin(hex) {
50
+ return (parseInt(hex, 16).toString(2)).padStart(16, '0');
51
+ }
52
+ function fromBitStatus(hex, index) {
53
+ return hex2bin(hex).substring(index, index + 1) === '1';
54
+ }
55
+ //# sourceMappingURL=fireplaceStatus.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fireplaceStatus.js","sourceRoot":"","sources":["../../src/models/fireplaceStatus.ts"],"names":[],"mappings":";;;AAAA,mDAAgD;AAEhD,MAAa,eAAe;IAS1B,YAAY,MAAc;QARV,UAAK,GAAY,KAAK,CAAC;QACvB,SAAI,GAAkB,6BAAa,CAAC,GAAG,CAAC;QACxC,uBAAkB,GAAW,EAAE,CAAC;QAChC,sBAAiB,GAAW,EAAE,CAAC;QAC/B,aAAQ,GAAY,KAAK,CAAC;QAC1B,iBAAY,GAAY,KAAK,CAAC;QAC9B,iBAAY,GAAY,KAAK,CAAC;QAG5C,MAAM,QAAQ,GAAG,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1C,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,aAAa,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACjD,IAAI,CAAC,YAAY,GAAG,aAAa,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC9C,IAAI,CAAC,kBAAkB,GAAG,QAAQ,CAAC,IAAI,GAAG,MAAM,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;QACzE,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,IAAI,GA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E,KAAK,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;AAC1D,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare enum FlameHeight {
2
+ Step0 = "3830",
3
+ Step1 = "3842",
4
+ Step2 = "3937",
5
+ Step3 = "4132",
6
+ Step4 = "4145",
7
+ Step5 = "4239",
8
+ Step6 = "4335",
9
+ Step7 = "4430",
10
+ Step8 = "4443",
11
+ Step9 = "4537",
12
+ Step10 = "4633",
13
+ Step11 = "4646",
14
+ StepUndefined = "undefined"
15
+ }
16
+ export declare class FlameHeightUtils {
17
+ static ofPercentage(value: number): FlameHeight;
18
+ static toPercentage(height: FlameHeight): number;
19
+ }
20
+ //# sourceMappingURL=flameHeight.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flameHeight.d.ts","sourceRoot":"","sources":["../../src/models/flameHeight.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACnB,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,SAAS;IACd,KAAK,SAAS;IACd,MAAM,SAAS;IACf,MAAM,SAAS;IACf,aAAa,cAAc;CAC5B;AAEH,qBAAa,gBAAgB;WACb,YAAY,CAAC,KAAK,EAAE,MAAM,GAAI,WAAW;WAQzC,YAAY,CAAC,MAAM,EAAE,WAAW,GAAI,MAAM;CAMzD"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FlameHeightUtils = exports.FlameHeight = void 0;
4
+ var FlameHeight;
5
+ (function (FlameHeight) {
6
+ FlameHeight["Step0"] = "3830";
7
+ FlameHeight["Step1"] = "3842";
8
+ FlameHeight["Step2"] = "3937";
9
+ FlameHeight["Step3"] = "4132";
10
+ FlameHeight["Step4"] = "4145";
11
+ FlameHeight["Step5"] = "4239";
12
+ FlameHeight["Step6"] = "4335";
13
+ FlameHeight["Step7"] = "4430";
14
+ FlameHeight["Step8"] = "4443";
15
+ FlameHeight["Step9"] = "4537";
16
+ FlameHeight["Step10"] = "4633";
17
+ FlameHeight["Step11"] = "4646";
18
+ FlameHeight["StepUndefined"] = "undefined";
19
+ })(FlameHeight = exports.FlameHeight || (exports.FlameHeight = {}));
20
+ class FlameHeightUtils {
21
+ static ofPercentage(value) {
22
+ const keys = Object.keys(FlameHeight);
23
+ const fullSteps = keys.length - 1;
24
+ const factorStep = value * fullSteps;
25
+ const index = Math.ceil(factorStep);
26
+ return Object.values(FlameHeight)[index];
27
+ }
28
+ static toPercentage(height) {
29
+ const values = Object.values(FlameHeight);
30
+ const index = values.indexOf(height);
31
+ const oneStep = 100 / (values.length - 1);
32
+ return (index * oneStep) / 100;
33
+ }
34
+ }
35
+ exports.FlameHeightUtils = FlameHeightUtils;
36
+ //# sourceMappingURL=flameHeight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flameHeight.js","sourceRoot":"","sources":["../../src/models/flameHeight.ts"],"names":[],"mappings":";;;AAAA,IAAY,WAcT;AAdH,WAAY,WAAW;IACnB,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,6BAAc,CAAA;IACd,8BAAe,CAAA;IACf,8BAAe,CAAA;IACf,0CAA2B,CAAA;AAC7B,CAAC,EAdS,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAcpB;AAEH,MAAa,gBAAgB;IACpB,MAAM,CAAC,YAAY,CAAC,KAAa;QACtC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QACtC,MAAM,SAAS,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QAClC,MAAM,UAAU,GAAG,KAAK,GAAG,SAAS,CAAC;QACrC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACpC,OAAO,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,KAAK,CAAC,CAAC;IAC3C,CAAC;IAEM,MAAM,CAAC,YAAY,CAAC,MAAmB;QAC5C,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;QAC1C,MAAM,KAAK,GAAW,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QAC1C,OAAO,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,GAAG,CAAC;IACjC,CAAC;CACF;AAfD,4CAeC"}
@@ -0,0 +1,17 @@
1
+ import { CharacteristicValue } from "homebridge";
2
+ import { ValorPlatform } from "../platform";
3
+ export declare enum OperationMode {
4
+ Off = 1,
5
+ Manual = 2,
6
+ Temperature = 3,
7
+ Eco = 4
8
+ }
9
+ export declare class OperationModeUtils {
10
+ static needsIgnite(mode: OperationMode): boolean;
11
+ static toHeatingCoolerState(platform: ValorPlatform, mode: OperationMode, guardFlameOn: boolean): CharacteristicValue;
12
+ static toTargetHeaterCoolerState(platform: ValorPlatform, mode: OperationMode): CharacteristicValue;
13
+ static ofHeaterCoolerState(platform: ValorPlatform, value: CharacteristicValue): OperationMode;
14
+ static toActive(platform: ValorPlatform, mode: OperationMode, igniting: boolean, shuttingDown: boolean): CharacteristicValue;
15
+ static ofActive(platform: ValorPlatform, value: CharacteristicValue, heatingCoolerStateValue: CharacteristicValue): OperationMode;
16
+ }
17
+ //# sourceMappingURL=operationMode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operationMode.d.ts","sourceRoot":"","sources":["../../src/models/operationMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,oBAAY,aAAa;IACvB,GAAG,IAAI;IACP,MAAM,IAAI;IACV,WAAW,IAAI;IACf,GAAG,IAAI;CACR;AAED,qBAAa,kBAAkB;WACf,WAAW,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO;WAWzC,oBAAoB,CAChC,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,aAAa,EACnB,YAAY,EAAE,OAAO,GACpB,mBAAmB;WAqBR,yBAAyB,CACrC,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,aAAa,GAClB,mBAAmB;WAaR,mBAAmB,CAC/B,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,mBAAmB,GACzB,aAAa;WAYF,QAAQ,CACpB,QAAQ,EAAE,aAAa,EACvB,IAAI,EAAE,aAAa,EACnB,QAAQ,EAAE,OAAO,EACjB,YAAY,EAAE,OAAO,GACpB,mBAAmB;WAMR,QAAQ,CACpB,QAAQ,EAAE,aAAa,EACvB,KAAK,EAAE,mBAAmB,EAC1B,uBAAuB,EAAE,mBAAmB,GAC3C,aAAa;CAKjB"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperationModeUtils = exports.OperationMode = void 0;
4
+ var OperationMode;
5
+ (function (OperationMode) {
6
+ OperationMode[OperationMode["Off"] = 1] = "Off";
7
+ OperationMode[OperationMode["Manual"] = 2] = "Manual";
8
+ OperationMode[OperationMode["Temperature"] = 3] = "Temperature";
9
+ OperationMode[OperationMode["Eco"] = 4] = "Eco";
10
+ })(OperationMode = exports.OperationMode || (exports.OperationMode = {}));
11
+ class OperationModeUtils {
12
+ static needsIgnite(mode) {
13
+ switch (mode) {
14
+ case OperationMode.Eco:
15
+ case OperationMode.Manual:
16
+ case OperationMode.Temperature:
17
+ return true;
18
+ default:
19
+ return false;
20
+ }
21
+ }
22
+ static toHeatingCoolerState(platform, mode, guardFlameOn) {
23
+ let state = platform.Characteristic.CurrentHeaterCoolerState.INACTIVE;
24
+ switch (mode) {
25
+ case OperationMode.Temperature:
26
+ state = platform.Characteristic.CurrentHeaterCoolerState.IDLE;
27
+ break;
28
+ case OperationMode.Eco:
29
+ state = platform.Characteristic.CurrentHeaterCoolerState.COOLING;
30
+ break;
31
+ case OperationMode.Manual:
32
+ state = platform.Characteristic.CurrentHeaterCoolerState.HEATING;
33
+ break;
34
+ default:
35
+ state = guardFlameOn
36
+ ? platform.Characteristic.CurrentHeaterCoolerState.IDLE
37
+ : platform.Characteristic.CurrentHeaterCoolerState.INACTIVE;
38
+ break;
39
+ }
40
+ return state;
41
+ }
42
+ static toTargetHeaterCoolerState(platform, mode) {
43
+ switch (mode) {
44
+ case OperationMode.Manual:
45
+ return platform.Characteristic.TargetHeaterCoolerState.HEAT;
46
+ case OperationMode.Temperature:
47
+ return platform.Characteristic.TargetHeaterCoolerState.HEAT; // Show as HEAT instead of AUTO
48
+ case OperationMode.Eco:
49
+ return platform.Characteristic.TargetHeaterCoolerState.COOL;
50
+ default:
51
+ return platform.Characteristic.TargetHeaterCoolerState.HEAT;
52
+ }
53
+ }
54
+ static ofHeaterCoolerState(platform, value) {
55
+ if (value === platform.Characteristic.TargetHeaterCoolerState.AUTO) {
56
+ return OperationMode.Temperature;
57
+ }
58
+ else if (value === platform.Characteristic.TargetHeaterCoolerState.COOL) {
59
+ return OperationMode.Eco;
60
+ }
61
+ else if (value === platform.Characteristic.TargetHeaterCoolerState.HEAT) {
62
+ return OperationMode.Temperature; // Use Temperature mode, not Manual
63
+ }
64
+ else {
65
+ return OperationMode.Off;
66
+ }
67
+ }
68
+ static toActive(platform, mode, igniting, shuttingDown) {
69
+ return mode === OperationMode.Off && (!igniting || shuttingDown)
70
+ ? platform.Characteristic.Active.INACTIVE
71
+ : platform.Characteristic.Active.ACTIVE;
72
+ }
73
+ static ofActive(platform, value, heatingCoolerStateValue) {
74
+ return value === platform.Characteristic.Active.ACTIVE
75
+ ? this.ofHeaterCoolerState(platform, heatingCoolerStateValue)
76
+ : OperationMode.Off;
77
+ }
78
+ }
79
+ exports.OperationModeUtils = OperationModeUtils;
80
+ //# sourceMappingURL=operationMode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operationMode.js","sourceRoot":"","sources":["../../src/models/operationMode.ts"],"names":[],"mappings":";;;AAGA,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,+CAAO,CAAA;IACP,qDAAU,CAAA;IACV,+DAAe,CAAA;IACf,+CAAO,CAAA;AACT,CAAC,EALW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAKxB;AAED,MAAa,kBAAkB;IACtB,MAAM,CAAC,WAAW,CAAC,IAAmB;QAC3C,QAAQ,IAAI,EAAE;YACZ,KAAK,aAAa,CAAC,GAAG,CAAC;YACvB,KAAK,aAAa,CAAC,MAAM,CAAC;YAC1B,KAAK,aAAa,CAAC,WAAW;gBAC5B,OAAO,IAAI,CAAC;YACd;gBACE,OAAO,KAAK,CAAC;SAChB;IACH,CAAC;IAEM,MAAM,CAAC,oBAAoB,CAChC,QAAuB,EACvB,IAAmB,EACnB,YAAqB;QAErB,IAAI,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,wBAAwB,CAAC,QAAQ,CAAC;QACtE,QAAQ,IAAI,EAAE;YACZ,KAAK,aAAa,CAAC,WAAW;gBAC5B,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,wBAAwB,CAAC,IAAI,CAAC;gBAC9D,MAAM;YACR,KAAK,aAAa,CAAC,GAAG;gBACpB,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,wBAAwB,CAAC,OAAO,CAAC;gBACjE,MAAM;YACR,KAAK,aAAa,CAAC,MAAM;gBACvB,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,wBAAwB,CAAC,OAAO,CAAC;gBACjE,MAAM;YACR;gBACE,KAAK,GAAG,YAAY;oBAClB,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,wBAAwB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QAAQ,IAAI,YAAY,CAAC;YAC9D,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ;YACzC,CAAC,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC;IAC5C,CAAC;IAEM,MAAM,CAAC,QAAQ,CACpB,QAAuB,EACvB,KAA0B,EAC1B,uBAA4C;QAE5C,OAAO,KAAK,KAAK,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM;YACpD,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,uBAAuB,CAAC;YAC7D,CAAC,CAAC,aAAa,CAAC,GAAG,CAAC;IACxB,CAAC;CACF;AAxFD,gDAwFC"}
@@ -0,0 +1,9 @@
1
+ import { FlameHeight } from './flameHeight';
2
+ import { OperationMode } from './operationMode';
3
+ export interface IRequest {
4
+ height?: FlameHeight;
5
+ mode?: OperationMode;
6
+ temperature?: number;
7
+ auxOn?: boolean;
8
+ }
9
+ //# sourceMappingURL=request.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../src/models/request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,MAAM,WAAW,QAAQ;IACrB,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=request.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request.js","sourceRoot":"","sources":["../../src/models/request.ts"],"names":[],"mappings":""}
@@ -0,0 +1,4 @@
1
+ export declare class TemperatureRangeUtils {
2
+ static toBits(value: number): string;
3
+ }
4
+ //# sourceMappingURL=temperatureRange.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temperatureRange.d.ts","sourceRoot":"","sources":["../../src/models/temperatureRange.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAqB;WAClB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAI,MAAM;CAc7C"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TemperatureRangeUtils = void 0;
4
+ class TemperatureRangeUtils {
5
+ static toBits(value) {
6
+ const temperature = value * 10;
7
+ const degrees = Math.floor(temperature / 16) * 100;
8
+ const decimals = (temperature % 16);
9
+ const startDecimalsBit = decimals > 0 ? 30 : 0;
10
+ const sum = degrees + decimals + startDecimalsBit;
11
+ if (temperature < 160) {
12
+ return '0' + (3000 + sum);
13
+ }
14
+ else if (temperature < 256) {
15
+ return '0' + (3100 + sum);
16
+ }
17
+ else {
18
+ return '1' + (1400 + sum);
19
+ }
20
+ }
21
+ }
22
+ exports.TemperatureRangeUtils = TemperatureRangeUtils;
23
+ //# sourceMappingURL=temperatureRange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"temperatureRange.js","sourceRoot":"","sources":["../../src/models/temperatureRange.ts"],"names":[],"mappings":";;;AAAA,MAAa,qBAAqB;IACzB,MAAM,CAAC,MAAM,CAAC,KAAa;QAChC,MAAM,WAAW,GAAG,KAAK,GAAG,EAAE,CAAC;QAC/B,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC;QACnD,MAAM,QAAQ,GAAG,CAAC,WAAW,GAAG,EAAE,CAAC,CAAC;QACpC,MAAM,gBAAgB,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QAC/C,MAAM,GAAG,GAAG,OAAO,GAAG,QAAQ,GAAG,gBAAgB,CAAC;QAClD,IAAI,WAAW,GAAG,GAAG,EAAE;YACrB,OAAO,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;SAC3B;aAAM,IAAI,WAAW,GAAG,GAAG,EAAE;YAC5B,OAAO,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,CAAC;SAC3B;aAAM;YACL,OAAO,GAAG,GAAG,CAAC,IAAI,GAAG,GAAG,CAAE,CAAC;SAC5B;IACH,CAAC;CACF;AAfD,sDAeC"}
@@ -0,0 +1,20 @@
1
+ import { API, DynamicPlatformPlugin, Logger, PlatformAccessory, PlatformConfig, Service, Characteristic } from 'homebridge';
2
+ /**
3
+ * HomebridgePlatform
4
+ * This class is the main constructor for your plugin, this is where you should
5
+ * parse the user config and discover/register accessories with Homebridge.
6
+ */
7
+ export declare class ValorPlatform implements DynamicPlatformPlugin {
8
+ readonly log: Logger;
9
+ readonly config: PlatformConfig;
10
+ readonly api: API;
11
+ readonly Service: typeof Service;
12
+ readonly Characteristic: typeof Characteristic;
13
+ readonly accessories: PlatformAccessory[];
14
+ readonly debugMode: boolean;
15
+ readonly temperatureUnit: 'C' | 'F';
16
+ constructor(log: Logger, config: PlatformConfig, api: API);
17
+ configureAccessory(accessory: PlatformAccessory): void;
18
+ configureDevices(): void;
19
+ }
20
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../src/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,GAAG,EACH,qBAAqB,EACrB,MAAM,EACN,iBAAiB,EACjB,cAAc,EACd,OAAO,EACP,cAAc,EACf,MAAM,YAAY,CAAC;AAMpB;;;;GAIG;AACH,qBAAa,aAAc,YAAW,qBAAqB;aAevC,GAAG,EAAE,MAAM;aACX,MAAM,EAAE,cAAc;aACtB,GAAG,EAAE,GAAG;IAhB1B,SAAgB,OAAO,EAAE,OAAO,OAAO,CAAwB;IAC/D,SAAgB,cAAc,EAAE,OAAO,cAAc,CACvB;IAG9B,SAAgB,WAAW,EAAE,iBAAiB,EAAE,CAAM;IAGtD,SAAgB,SAAS,EAAE,OAAO,CAAC;IAGnC,SAAgB,eAAe,EAAE,GAAG,GAAG,GAAG,CAAC;gBAGzB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,cAAc,EACtB,GAAG,EAAE,GAAG;IAgB1B,kBAAkB,CAAC,SAAS,EAAE,iBAAiB;IAK/C,gBAAgB;CAoDjB"}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValorPlatform = void 0;
4
+ const settings_1 = require("./settings");
5
+ const platformAccessory_1 = require("./platformAccessory");
6
+ /**
7
+ * HomebridgePlatform
8
+ * This class is the main constructor for your plugin, this is where you should
9
+ * parse the user config and discover/register accessories with Homebridge.
10
+ */
11
+ class ValorPlatform {
12
+ constructor(log, config, api) {
13
+ this.log = log;
14
+ this.config = config;
15
+ this.api = api;
16
+ this.Service = this.api.hap.Service;
17
+ this.Characteristic = this.api.hap.Characteristic;
18
+ // this is used to track restored cached accessories
19
+ this.accessories = [];
20
+ this.debugMode = this.config.debug === true;
21
+ this.temperatureUnit = this.config.temperatureUnit === 'F' ? 'F' : 'C';
22
+ this.log.debug('Finished initializing platform:', this.config.name);
23
+ if (this.debugMode) {
24
+ this.log.info('Debug mode enabled - all status updates will be logged');
25
+ }
26
+ this.log.info(`Temperature unit: ${this.temperatureUnit === 'F' ? 'Fahrenheit' : 'Celsius'}`);
27
+ this.api.on('didFinishLaunching', () => {
28
+ log.debug('Executed didFinishLaunching callback');
29
+ this.configureDevices();
30
+ });
31
+ }
32
+ configureAccessory(accessory) {
33
+ this.log.info('Loading accessory from cache:', accessory.displayName);
34
+ this.accessories.push(accessory);
35
+ }
36
+ configureDevices() {
37
+ var _a;
38
+ const configuredDevices = (_a = this.config['fireplaces']) !== null && _a !== void 0 ? _a : new Array();
39
+ const devicesMap = configuredDevices.reduce((a, x) => ({ ...a, [x.name]: x.ip }), {});
40
+ for (const configuredDevice of configuredDevices) {
41
+ if (!configuredDevice.name) {
42
+ this.log.error('No valid fireplace name given!');
43
+ return;
44
+ }
45
+ const uuid = this.api.hap.uuid.generate(configuredDevice.name);
46
+ const accessory = this.accessories.find((a) => a.UUID === uuid);
47
+ if (accessory) {
48
+ this.log.info('Restoring existing fireplace from cache:', accessory.displayName);
49
+ accessory.category = 20 /* this.api.hap.Categories.AIR_HEATER */;
50
+ accessory.context.device = configuredDevice;
51
+ new platformAccessory_1.FireplacePlatformAccessory(this, accessory);
52
+ this.api.updatePlatformAccessories([accessory]);
53
+ }
54
+ else {
55
+ this.log.info('Adding new fireplace:', configuredDevice.name);
56
+ const newAccessory = new this.api.platformAccessory(configuredDevice.name, uuid);
57
+ newAccessory.category = 20 /* this.api.hap.Categories.AIR_HEATER */;
58
+ newAccessory.context.device = configuredDevice;
59
+ new platformAccessory_1.FireplacePlatformAccessory(this, newAccessory);
60
+ this.api.registerPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [
61
+ newAccessory,
62
+ ]);
63
+ }
64
+ }
65
+ // Delete previously configured devices that don't exist anymore
66
+ for (const existingAccessory of this.accessories) {
67
+ if (!devicesMap[existingAccessory.context.device.name]) {
68
+ this.log.debug('Removing unconfigured fireplace');
69
+ this.api.unregisterPlatformAccessories(settings_1.PLUGIN_NAME, settings_1.PLATFORM_NAME, [
70
+ existingAccessory,
71
+ ]);
72
+ this.log.info('Removing existing fireplace from cache:', existingAccessory.displayName);
73
+ }
74
+ }
75
+ }
76
+ }
77
+ exports.ValorPlatform = ValorPlatform;
78
+ //# sourceMappingURL=platform.js.map