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.
- package/.husky/pre-commit +0 -0
- package/config.schema.json +6 -0
- package/dist/accessory/AccessoryFactory.d.ts +12 -12
- package/dist/accessory/AccessoryFactory.js +31 -31
- package/dist/accessory/AirConditionerAccessory.d.ts +92 -89
- package/dist/accessory/AirConditionerAccessory.d.ts.map +1 -1
- package/dist/accessory/AirConditionerAccessory.js +607 -584
- package/dist/accessory/AirConditionerAccessory.js.map +1 -1
- package/dist/accessory/BaseAccessory.d.ts +11 -11
- package/dist/accessory/BaseAccessory.js +21 -21
- package/dist/accessory/DehumidifierAccessory.d.ts +45 -45
- package/dist/accessory/DehumidifierAccessory.js +344 -344
- package/dist/accessory/DishwasherAccessory.d.ts +30 -28
- package/dist/accessory/DishwasherAccessory.d.ts.map +1 -1
- package/dist/accessory/DishwasherAccessory.js +63 -62
- package/dist/accessory/DishwasherAccessory.js.map +1 -1
- package/dist/accessory/ElectricWaterHeaterAccessory.d.ts +44 -44
- package/dist/accessory/ElectricWaterHeaterAccessory.js +176 -176
- package/dist/accessory/FanAccessory.d.ts +39 -39
- package/dist/accessory/FanAccessory.js +123 -123
- package/dist/accessory/FrontLoadWasherAccessory.d.ts +30 -30
- package/dist/accessory/FrontLoadWasherAccessory.d.ts.map +1 -1
- package/dist/accessory/FrontLoadWasherAccessory.js +66 -60
- package/dist/accessory/FrontLoadWasherAccessory.js.map +1 -1
- package/dist/accessory/GasWaterHeaterAccessory.d.ts +51 -51
- package/dist/accessory/GasWaterHeaterAccessory.js +216 -216
- package/dist/core/MideaCloud.d.ts +35 -35
- package/dist/core/MideaCloud.js +350 -350
- package/dist/core/MideaConstants.d.ts +50 -50
- package/dist/core/MideaConstants.js +58 -58
- package/dist/core/MideaDevice.d.ts +76 -76
- package/dist/core/MideaDevice.js +409 -409
- package/dist/core/MideaDiscover.d.ts +35 -35
- package/dist/core/MideaDiscover.js +212 -212
- package/dist/core/MideaMessage.d.ts +75 -75
- package/dist/core/MideaMessage.js +184 -184
- package/dist/core/MideaPacketBuilder.d.ts +10 -10
- package/dist/core/MideaPacketBuilder.js +60 -60
- package/dist/core/MideaSecurity.d.ts +63 -63
- package/dist/core/MideaSecurity.js +251 -251
- package/dist/core/MideaUtils.d.ts +32 -32
- package/dist/core/MideaUtils.js +181 -181
- package/dist/devices/DeviceFactory.d.ts +13 -13
- package/dist/devices/DeviceFactory.js +36 -36
- package/dist/devices/a1/MideaA1Device.d.ts +76 -76
- package/dist/devices/a1/MideaA1Device.js +145 -145
- package/dist/devices/a1/MideaA1Device.js.map +1 -1
- package/dist/devices/a1/MideaA1Message.d.ts +40 -40
- package/dist/devices/a1/MideaA1Message.js +198 -198
- package/dist/devices/ac/MideaACDevice.d.ts +104 -100
- package/dist/devices/ac/MideaACDevice.d.ts.map +1 -1
- package/dist/devices/ac/MideaACDevice.js +384 -367
- package/dist/devices/ac/MideaACDevice.js.map +1 -1
- package/dist/devices/ac/MideaACMessage.d.ts +94 -92
- package/dist/devices/ac/MideaACMessage.d.ts.map +1 -1
- package/dist/devices/ac/MideaACMessage.js +611 -589
- package/dist/devices/ac/MideaACMessage.js.map +1 -1
- package/dist/devices/db/MideaDBDevice.d.ts +29 -29
- package/dist/devices/db/MideaDBDevice.js +100 -100
- package/dist/devices/db/MideaDBDevice.js.map +1 -1
- package/dist/devices/db/MideaDBMessage.d.ts +32 -32
- package/dist/devices/db/MideaDBMessage.js +101 -101
- package/dist/devices/e1/MideaE1Device.d.ts +56 -56
- package/dist/devices/e1/MideaE1Device.js +128 -128
- package/dist/devices/e1/MideaE1Device.js.map +1 -1
- package/dist/devices/e1/MideaE1Message.d.ts +28 -28
- package/dist/devices/e1/MideaE1Message.js +107 -107
- package/dist/devices/e2/MideaE2Device.d.ts +44 -44
- package/dist/devices/e2/MideaE2Device.js +129 -129
- package/dist/devices/e2/MideaE2Device.js.map +1 -1
- package/dist/devices/e2/MideaE2Message.d.ts +33 -33
- package/dist/devices/e2/MideaE2Message.js +132 -132
- package/dist/devices/e3/MideaE3Device.d.ts +43 -43
- package/dist/devices/e3/MideaE3Device.js +137 -137
- package/dist/devices/e3/MideaE3Device.js.map +1 -1
- package/dist/devices/e3/MideaE3Message.d.ts +51 -51
- package/dist/devices/e3/MideaE3Message.js +136 -136
- package/dist/devices/fa/MideaFADevice.d.ts +36 -36
- package/dist/devices/fa/MideaFADevice.js +106 -106
- package/dist/devices/fa/MideaFADevice.js.map +1 -1
- package/dist/devices/fa/MideaFAMessage.d.ts +38 -38
- package/dist/devices/fa/MideaFAMessage.js +98 -98
- package/dist/index.d.ts +6 -6
- package/dist/index.js +6 -6
- package/dist/platform.d.ts +60 -60
- package/dist/platform.js +212 -212
- package/dist/platformUtils.d.ts +106 -105
- package/dist/platformUtils.d.ts.map +1 -1
- package/dist/platformUtils.js +101 -100
- package/dist/platformUtils.js.map +1 -1
- package/dist/settings.d.ts +8 -8
- package/dist/settings.js +11 -11
- package/package.json +1 -1
- 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;
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
return this.device.attributes.
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
|
|
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=DishwasherAccessory.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DishwasherAccessory.js","sourceRoot":"","sources":["../../src/accessory/DishwasherAccessory.ts"],"names":[],"mappings":";;;;;AAYA,oEAA4C;AAI5C,MAAqB,mBAAoB,SAAQ,uBAA4B;IAG3E;;;OAGG;IACH,YACE,QAAuB,EACvB,SAAyB,EACN,MAAqB,EACrB,SAAuB;QAE1C,KAAK,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,CAAC;QAH3B,WAAM,GAAN,MAAM,CAAe;QACrB,cAAS,GAAT,SAAS,CAAc;QAI1C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QAEhI,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"DishwasherAccessory.js","sourceRoot":"","sources":["../../src/accessory/DishwasherAccessory.ts"],"names":[],"mappings":";;;;;AAYA,oEAA4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;QACP,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,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
|