homebridge-midea-platform 1.2.0-beta.1 → 1.2.0-beta.2

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 (94) hide show
  1. package/.husky/pre-commit +0 -0
  2. package/config.schema.json +6 -0
  3. package/dist/accessory/AccessoryFactory.d.ts +12 -12
  4. package/dist/accessory/AccessoryFactory.js +31 -31
  5. package/dist/accessory/AirConditionerAccessory.d.ts +92 -89
  6. package/dist/accessory/AirConditionerAccessory.d.ts.map +1 -1
  7. package/dist/accessory/AirConditionerAccessory.js +607 -584
  8. package/dist/accessory/AirConditionerAccessory.js.map +1 -1
  9. package/dist/accessory/BaseAccessory.d.ts +11 -11
  10. package/dist/accessory/BaseAccessory.js +21 -21
  11. package/dist/accessory/DehumidifierAccessory.d.ts +45 -45
  12. package/dist/accessory/DehumidifierAccessory.js +344 -344
  13. package/dist/accessory/DishwasherAccessory.d.ts +30 -28
  14. package/dist/accessory/DishwasherAccessory.d.ts.map +1 -1
  15. package/dist/accessory/DishwasherAccessory.js +63 -62
  16. package/dist/accessory/DishwasherAccessory.js.map +1 -1
  17. package/dist/accessory/ElectricWaterHeaterAccessory.d.ts +44 -44
  18. package/dist/accessory/ElectricWaterHeaterAccessory.js +176 -176
  19. package/dist/accessory/FanAccessory.d.ts +39 -39
  20. package/dist/accessory/FanAccessory.js +123 -123
  21. package/dist/accessory/FrontLoadWasherAccessory.d.ts +30 -30
  22. package/dist/accessory/FrontLoadWasherAccessory.d.ts.map +1 -1
  23. package/dist/accessory/FrontLoadWasherAccessory.js +66 -60
  24. package/dist/accessory/FrontLoadWasherAccessory.js.map +1 -1
  25. package/dist/accessory/GasWaterHeaterAccessory.d.ts +51 -51
  26. package/dist/accessory/GasWaterHeaterAccessory.js +216 -216
  27. package/dist/core/MideaCloud.d.ts +35 -35
  28. package/dist/core/MideaCloud.js +350 -350
  29. package/dist/core/MideaConstants.d.ts +50 -50
  30. package/dist/core/MideaConstants.js +58 -58
  31. package/dist/core/MideaDevice.d.ts +76 -76
  32. package/dist/core/MideaDevice.js +409 -409
  33. package/dist/core/MideaDiscover.d.ts +35 -35
  34. package/dist/core/MideaDiscover.js +212 -212
  35. package/dist/core/MideaMessage.d.ts +75 -75
  36. package/dist/core/MideaMessage.js +184 -184
  37. package/dist/core/MideaPacketBuilder.d.ts +10 -10
  38. package/dist/core/MideaPacketBuilder.js +60 -60
  39. package/dist/core/MideaSecurity.d.ts +63 -63
  40. package/dist/core/MideaSecurity.js +251 -251
  41. package/dist/core/MideaUtils.d.ts +32 -32
  42. package/dist/core/MideaUtils.js +181 -181
  43. package/dist/devices/DeviceFactory.d.ts +13 -13
  44. package/dist/devices/DeviceFactory.js +36 -36
  45. package/dist/devices/a1/MideaA1Device.d.ts +76 -76
  46. package/dist/devices/a1/MideaA1Device.js +145 -145
  47. package/dist/devices/a1/MideaA1Device.js.map +1 -1
  48. package/dist/devices/a1/MideaA1Message.d.ts +40 -40
  49. package/dist/devices/a1/MideaA1Message.js +198 -198
  50. package/dist/devices/ac/MideaACDevice.d.ts +104 -100
  51. package/dist/devices/ac/MideaACDevice.d.ts.map +1 -1
  52. package/dist/devices/ac/MideaACDevice.js +384 -367
  53. package/dist/devices/ac/MideaACDevice.js.map +1 -1
  54. package/dist/devices/ac/MideaACMessage.d.ts +94 -92
  55. package/dist/devices/ac/MideaACMessage.d.ts.map +1 -1
  56. package/dist/devices/ac/MideaACMessage.js +611 -589
  57. package/dist/devices/ac/MideaACMessage.js.map +1 -1
  58. package/dist/devices/db/MideaDBDevice.d.ts +29 -29
  59. package/dist/devices/db/MideaDBDevice.js +100 -100
  60. package/dist/devices/db/MideaDBDevice.js.map +1 -1
  61. package/dist/devices/db/MideaDBMessage.d.ts +32 -32
  62. package/dist/devices/db/MideaDBMessage.js +101 -101
  63. package/dist/devices/e1/MideaE1Device.d.ts +56 -56
  64. package/dist/devices/e1/MideaE1Device.js +128 -128
  65. package/dist/devices/e1/MideaE1Device.js.map +1 -1
  66. package/dist/devices/e1/MideaE1Message.d.ts +28 -28
  67. package/dist/devices/e1/MideaE1Message.js +107 -107
  68. package/dist/devices/e2/MideaE2Device.d.ts +44 -44
  69. package/dist/devices/e2/MideaE2Device.js +129 -129
  70. package/dist/devices/e2/MideaE2Device.js.map +1 -1
  71. package/dist/devices/e2/MideaE2Message.d.ts +33 -33
  72. package/dist/devices/e2/MideaE2Message.js +132 -132
  73. package/dist/devices/e3/MideaE3Device.d.ts +43 -43
  74. package/dist/devices/e3/MideaE3Device.js +137 -137
  75. package/dist/devices/e3/MideaE3Device.js.map +1 -1
  76. package/dist/devices/e3/MideaE3Message.d.ts +51 -51
  77. package/dist/devices/e3/MideaE3Message.js +136 -136
  78. package/dist/devices/fa/MideaFADevice.d.ts +36 -36
  79. package/dist/devices/fa/MideaFADevice.js +106 -106
  80. package/dist/devices/fa/MideaFADevice.js.map +1 -1
  81. package/dist/devices/fa/MideaFAMessage.d.ts +38 -38
  82. package/dist/devices/fa/MideaFAMessage.js +98 -98
  83. package/dist/index.d.ts +6 -6
  84. package/dist/index.js +6 -6
  85. package/dist/platform.d.ts +60 -60
  86. package/dist/platform.js +212 -212
  87. package/dist/platformUtils.d.ts +106 -105
  88. package/dist/platformUtils.d.ts.map +1 -1
  89. package/dist/platformUtils.js +101 -100
  90. package/dist/platformUtils.js.map +1 -1
  91. package/dist/settings.d.ts +8 -8
  92. package/dist/settings.js +11 -11
  93. package/package.json +1 -1
  94. package/AC_ori.lua +0 -5150
@@ -1,29 +1,31 @@
1
- /***********************************************************************
2
- * Midea Platform Dishwasher Accessory class
3
- *
4
- * Copyright (c) 2024 Kovalovszky Patrik, https://github.com/kovapatrik
5
- *
6
- * Based on https://github.com/homebridge/homebridge-plugin-template
7
- *
8
- * An instance of this class is created for each accessory the platform registers.
9
- *
10
- */
11
- import { CharacteristicValue } from 'homebridge';
12
- import { MideaAccessory, MideaPlatform } from '../platform';
13
- import BaseAccessory from './BaseAccessory';
14
- import { DeviceConfig } from '../platformUtils';
15
- import MideaE1Device, { E1Attributes } from '../devices/e1/MideaE1Device';
16
- export default class DishwasherAccessory extends BaseAccessory<MideaE1Device> {
17
- protected readonly device: MideaE1Device;
18
- protected readonly configDev: DeviceConfig;
19
- private service;
20
- /*********************************************************************
21
- * Constructor registers all the service types with Homebridge, registers
22
- * a callback function with the MideaDevice class, and requests device status.
23
- */
24
- constructor(platform: MideaPlatform, accessory: MideaAccessory, device: MideaE1Device, configDev: DeviceConfig);
25
- updateCharacteristics(attributes: Partial<E1Attributes>): Promise<void>;
26
- getActive(): CharacteristicValue;
27
- setActive(value: CharacteristicValue): Promise<void>;
28
- }
1
+ /***********************************************************************
2
+ * Midea Platform Dishwasher Accessory class
3
+ *
4
+ * Copyright (c) 2024 Kovalovszky Patrik, https://github.com/kovapatrik
5
+ *
6
+ * Based on https://github.com/homebridge/homebridge-plugin-template
7
+ *
8
+ * An instance of this class is created for each accessory the platform registers.
9
+ *
10
+ */
11
+ import { CharacteristicValue } from 'homebridge';
12
+ import { MideaAccessory, MideaPlatform } from '../platform';
13
+ import BaseAccessory from './BaseAccessory';
14
+ import { DeviceConfig } from '../platformUtils';
15
+ import MideaE1Device, { E1Attributes } from '../devices/e1/MideaE1Device';
16
+ export default class DishwasherAccessory extends BaseAccessory<MideaE1Device> {
17
+ protected readonly device: MideaE1Device;
18
+ protected readonly configDev: DeviceConfig;
19
+ private service;
20
+ /*********************************************************************
21
+ * Constructor registers all the service types with Homebridge, registers
22
+ * a callback function with the MideaDevice class, and requests device status.
23
+ */
24
+ constructor(platform: MideaPlatform, accessory: MideaAccessory, device: MideaE1Device, configDev: DeviceConfig);
25
+ updateCharacteristics(attributes: Partial<E1Attributes>): Promise<void>;
26
+ getActive(): CharacteristicValue;
27
+ setActive(value: CharacteristicValue): Promise<void>;
28
+ getInUse(): CharacteristicValue;
29
+ getRemainingDuration(): CharacteristicValue;
30
+ }
29
31
  //# sourceMappingURL=DishwasherAccessory.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DishwasherAccessory.d.ts","sourceRoot":"","sources":["../../src/accessory/DishwasherAccessory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,mBAAmB,EAAW,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,aAAa,EAAE,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,aAAa,CAAC,aAAa,CAAC;IAUzE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa;IACxC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,YAAY;IAV5C,OAAO,CAAC,OAAO,CAAU;IAEzB;;;OAGG;gBAED,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAE,cAAc,EACN,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,YAAY;IActC,qBAAqB,CAAC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC;IAiC7D,SAAS,IAAI,mBAAmB;IAI1B,SAAS,CAAC,KAAK,EAAE,mBAAmB;CAG3C"}
1
+ {"version":3,"file":"DishwasherAccessory.d.ts","sourceRoot":"","sources":["../../src/accessory/DishwasherAccessory.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,mBAAmB,EAAW,MAAM,YAAY,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,aAAa,EAAE,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE1E,MAAM,CAAC,OAAO,OAAO,mBAAoB,SAAQ,aAAa,CAAC,aAAa,CAAC;IAUzE,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,aAAa;IACxC,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,YAAY;IAV5C,OAAO,CAAC,OAAO,CAAU;IAEzB;;;OAGG;gBAED,QAAQ,EAAE,aAAa,EACvB,SAAS,EAAE,cAAc,EACN,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,YAAY;IAiBtC,qBAAqB,CAAC,UAAU,EAAE,OAAO,CAAC,YAAY,CAAC;IAuB7D,SAAS,IAAI,mBAAmB;IAI1B,SAAS,CAAC,KAAK,EAAE,mBAAmB;IAI1C,QAAQ,IAAI,mBAAmB;IAI/B,oBAAoB,IAAI,mBAAmB;CAG5C"}
@@ -1,63 +1,64 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const BaseAccessory_1 = __importDefault(require("./BaseAccessory"));
7
- class DishwasherAccessory extends BaseAccessory_1.default {
8
- /*********************************************************************
9
- * Constructor registers all the service types with Homebridge, registers
10
- * a callback function with the MideaDevice class, and requests device status.
11
- */
12
- constructor(platform, accessory, device, configDev) {
13
- super(platform, accessory, device, configDev);
14
- this.device = device;
15
- this.configDev = configDev;
16
- this.service = this.accessory.getService(this.platform.Service.Valve) || this.accessory.addService(this.platform.Service.Valve);
17
- this.service.getCharacteristic(this.platform.Characteristic.Active).onGet(this.getActive.bind(this)).onSet(this.setActive.bind(this));
18
- // this.service
19
- // .getCharacteristic(this.platform.Characteristic.TargetDishwasherState)
20
- // .onGet(this.getTargetDishwasherState.bind(this))
21
- // .onSet(this.setTargetDishwasherState.bind(this));
22
- }
23
- async updateCharacteristics(attributes) {
24
- const updateState = false;
25
- for (const [k, v] of Object.entries(attributes)) {
26
- this.platform.log.debug(`[${this.device.name}] Set attribute ${k} to: ${v}`);
27
- switch (k) {
28
- // case 'power':
29
- // updateState = true;
30
- // break;
31
- // case 'mode':
32
- // this.service.updateCharacteristic(this.platform.Characteristic.TargetDishwasherState, this.getTargetDishwasherState());
33
- // break;
34
- // case 'Dishwasher_speed':
35
- // this.service.updateCharacteristic(this.platform.Characteristic.RotationSpeed, this.getRotationSpeed());
36
- // break;
37
- // case 'child_lock':
38
- // this.service.updateCharacteristic(this.platform.Characteristic.LockPhysicalControls, this.getLockPhysicalControls());
39
- // break;
40
- // case 'oscillate':
41
- // case 'oscillation_angle':
42
- // case 'oscillation_mode':
43
- // case 'tilting_angle':
44
- // this.service.updateCharacteristic(this.platform.Characteristic.SwingMode, this.getSwingMode());
45
- // break;
46
- default:
47
- this.platform.log.debug(`[${this.device.name}] Attempt to set unsupported attribute ${k} to ${v}`);
48
- break;
49
- }
50
- }
51
- if (updateState) {
52
- this.service.updateCharacteristic(this.platform.Characteristic.Active, this.getActive());
53
- }
54
- }
55
- getActive() {
56
- return this.device.attributes.POWER ? this.platform.Characteristic.Active.ACTIVE : this.platform.Characteristic.Active.INACTIVE;
57
- }
58
- async setActive(value) {
59
- await this.device.set_attribute({ POWER: value === this.platform.Characteristic.Active.ACTIVE });
60
- }
61
- }
62
- exports.default = DishwasherAccessory;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const BaseAccessory_1 = __importDefault(require("./BaseAccessory"));
7
+ class DishwasherAccessory extends BaseAccessory_1.default {
8
+ /*********************************************************************
9
+ * Constructor registers all the service types with Homebridge, registers
10
+ * a callback function with the MideaDevice class, and requests device status.
11
+ */
12
+ constructor(platform, accessory, device, configDev) {
13
+ super(platform, accessory, device, configDev);
14
+ this.device = device;
15
+ this.configDev = configDev;
16
+ this.service = this.accessory.getService(this.platform.Service.Valve) || this.accessory.addService(this.platform.Service.Valve);
17
+ this.service.getCharacteristic(this.platform.Characteristic.Active).onGet(this.getActive.bind(this)).onSet(this.setActive.bind(this));
18
+ this.service.getCharacteristic(this.platform.Characteristic.InUse).onGet(this.getInUse.bind(this));
19
+ this.service
20
+ .getCharacteristic(this.platform.Characteristic.ValveType)
21
+ .onGet(() => this.platform.Characteristic.ValveType.GENERIC_VALVE);
22
+ this.service
23
+ .getCharacteristic(this.platform.Characteristic.RemainingDuration)
24
+ .setProps({ minValue: 0, maxValue: 60 * 60 * 8, minStep: 1 })
25
+ .onGet(this.getRemainingDuration.bind(this));
26
+ }
27
+ async updateCharacteristics(attributes) {
28
+ let updateState = false;
29
+ for (const [k, v] of Object.entries(attributes)) {
30
+ this.platform.log.debug(`[${this.device.name}] Set attribute ${k} to: ${v}`);
31
+ switch (k) {
32
+ case 'power':
33
+ updateState = true;
34
+ break;
35
+ case 'mode':
36
+ updateState = true;
37
+ break;
38
+ default:
39
+ this.platform.log.debug(`[${this.device.name}] Attempt to set unsupported attribute ${k} to ${v}`);
40
+ break;
41
+ }
42
+ }
43
+ if (updateState) {
44
+ this.service.updateCharacteristic(this.platform.Characteristic.Active, this.getActive());
45
+ this.service.updateCharacteristic(this.platform.Characteristic.InUse, this.getInUse());
46
+ this.service.updateCharacteristic(this.platform.Characteristic.RemainingDuration, this.getRemainingDuration());
47
+ }
48
+ }
49
+ getActive() {
50
+ return this.device.attributes.POWER ? this.platform.Characteristic.Active.ACTIVE : this.platform.Characteristic.Active.INACTIVE;
51
+ }
52
+ async setActive(value) {
53
+ await this.device.set_attribute({ POWER: value === this.platform.Characteristic.Active.ACTIVE });
54
+ }
55
+ getInUse() {
56
+ return this.device.attributes.START ? this.platform.Characteristic.InUse.IN_USE : this.platform.Characteristic.InUse.NOT_IN_USE;
57
+ }
58
+ getRemainingDuration() {
59
+ var _a;
60
+ return ((_a = this.device.attributes.TIME_REMAINING) !== null && _a !== void 0 ? _a : 0) * 60; // in seconds
61
+ }
62
+ }
63
+ exports.default = DishwasherAccessory;
63
64
  //# sourceMappingURL=DishwasherA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AAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,QAAQ,CAAC;IAClI,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,KAA0B;QACxC,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;IACnG,CAAC;IAED,QAAQ;QACN,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,KAAK,CAAC,UAAU,CAAC;IAClI,CAAC;IAED,oBAAoB;;QAClB,OAAO,CAAC,MAAA,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,cAAc,mCAAI,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,aAAa;IACzE,CAAC;CACF;AAlED,sCAkEC"}
@@ -1,45 +1,45 @@
1
- /***********************************************************************
2
- * Midea Platform Electric Water Heater Accessory class
3
- *
4
- * Copyright (c) 2024 Kovalovszky Patrik, https://github.com/kovapatrik
5
- *
6
- * Based on https://github.com/homebridge/homebridge-plugin-template
7
- *
8
- * An instance of this class is created for each accessory the platform registers.
9
- *
10
- */
11
- import { CharacteristicValue } from 'homebridge';
12
- import MideaE2Device, { E2Attributes } from '../devices/e2/MideaE2Device';
13
- import BaseAccessory from './BaseAccessory';
14
- import { MideaAccessory, MideaPlatform } from '../platform';
15
- import { DeviceConfig } from '../platformUtils';
16
- export default class ElectricWaterHeaterAccessory extends BaseAccessory<MideaE2Device> {
17
- protected readonly device: MideaE2Device;
18
- protected readonly configDev: DeviceConfig;
19
- private service;
20
- private variableHeatingService?;
21
- private wholeTankHeatingService?;
22
- constructor(platform: MideaPlatform, accessory: MideaAccessory, device: MideaE2Device, configDev: DeviceConfig);
23
- /*********************************************************************
24
- * Callback function called by MideaDevice whenever there is a change to
25
- * any attribute value.
26
- */
27
- protected updateCharacteristics(attributes: Partial<E2Attributes>): Promise<void>;
28
- /*********************************************************************
29
- * Callback functions for each Homebridge/HomeKit service
30
- *
31
- */
32
- getActive(): CharacteristicValue;
33
- setActive(value: CharacteristicValue): Promise<void>;
34
- getCurrentHeaterCoolerState(): CharacteristicValue;
35
- getTargetHeaterCoolerState(): CharacteristicValue;
36
- setTargetHeaterCoolerState(value: CharacteristicValue): Promise<void>;
37
- getCurrentTemperature(): CharacteristicValue;
38
- getTargetTemperature(): CharacteristicValue;
39
- setTargetTemperature(value: CharacteristicValue): Promise<void>;
40
- getVariableHeating(): CharacteristicValue;
41
- setVariableHeating(value: CharacteristicValue): Promise<void>;
42
- getWholeTankHeating(): CharacteristicValue;
43
- setWholeTankHeating(value: CharacteristicValue): Promise<void>;
44
- }
1
+ /***********************************************************************
2
+ * Midea Platform Electric Water Heater Accessory class
3
+ *
4
+ * Copyright (c) 2024 Kovalovszky Patrik, https://github.com/kovapatrik
5
+ *
6
+ * Based on https://github.com/homebridge/homebridge-plugin-template
7
+ *
8
+ * An instance of this class is created for each accessory the platform registers.
9
+ *
10
+ */
11
+ import { CharacteristicValue } from 'homebridge';
12
+ import MideaE2Device, { E2Attributes } from '../devices/e2/MideaE2Device';
13
+ import BaseAccessory from './BaseAccessory';
14
+ import { MideaAccessory, MideaPlatform } from '../platform';
15
+ import { DeviceConfig } from '../platformUtils';
16
+ export default class ElectricWaterHeaterAccessory extends BaseAccessory<MideaE2Device> {
17
+ protected readonly device: MideaE2Device;
18
+ protected readonly configDev: DeviceConfig;
19
+ private service;
20
+ private variableHeatingService?;
21
+ private wholeTankHeatingService?;
22
+ constructor(platform: MideaPlatform, accessory: MideaAccessory, device: MideaE2Device, configDev: DeviceConfig);
23
+ /*********************************************************************
24
+ * Callback function called by MideaDevice whenever there is a change to
25
+ * any attribute value.
26
+ */
27
+ protected updateCharacteristics(attributes: Partial<E2Attributes>): Promise<void>;
28
+ /*********************************************************************
29
+ * Callback functions for each Homebridge/HomeKit service
30
+ *
31
+ */
32
+ getActive(): CharacteristicValue;
33
+ setActive(value: CharacteristicValue): Promise<void>;
34
+ getCurrentHeaterCoolerState(): CharacteristicValue;
35
+ getTargetHeaterCoolerState(): CharacteristicValue;
36
+ setTargetHeaterCoolerState(value: CharacteristicValue): Promise<void>;
37
+ getCurrentTemperature(): CharacteristicValue;
38
+ getTargetTemperature(): CharacteristicValue;
39
+ setTargetTemperature(value: CharacteristicValue): Promise<void>;
40
+ getVariableHeating(): CharacteristicValue;
41
+ setVariableHeating(value: CharacteristicValue): Promise<void>;
42
+ getWholeTankHeating(): CharacteristicValue;
43
+ setWholeTankHeating(value: CharacteristicValue): Promise<void>;
44
+ }
45
45
  //# sourceMappingURL=ElectricWaterHeaterAccessory.d.ts.map