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,102 +1,102 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.MessageDBResponse = exports.DBGeneralMessageBody = exports.MessageStart = exports.MessagePower = exports.MessageQuery = void 0;
|
|
4
|
-
const MideaConstants_1 = require("../../core/MideaConstants");
|
|
5
|
-
const MideaMessage_1 = require("../../core/MideaMessage");
|
|
6
|
-
class MessageDBBase extends MideaMessage_1.MessageRequest {
|
|
7
|
-
constructor(device_protocol_version, message_type, body_type) {
|
|
8
|
-
super(MideaConstants_1.DeviceType.FRONT_LOAD_WASHER, message_type, body_type, device_protocol_version);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
class MessageQuery extends MessageDBBase {
|
|
12
|
-
constructor(device_protocol_version) {
|
|
13
|
-
super(device_protocol_version, MideaMessage_1.MessageType.QUERY, 0x03);
|
|
14
|
-
}
|
|
15
|
-
get _body() {
|
|
16
|
-
return Buffer.alloc(0);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.MessageQuery = MessageQuery;
|
|
20
|
-
class MessagePower extends MessageDBBase {
|
|
21
|
-
constructor(device_protocol_version) {
|
|
22
|
-
super(device_protocol_version, MideaMessage_1.MessageType.SET, 0x02);
|
|
23
|
-
this.power = false;
|
|
24
|
-
}
|
|
25
|
-
get _body() {
|
|
26
|
-
const power = this.power ? 0x01 : 0x00;
|
|
27
|
-
return Buffer.from([
|
|
28
|
-
power,
|
|
29
|
-
0xff,
|
|
30
|
-
0xff,
|
|
31
|
-
0xff,
|
|
32
|
-
0xff,
|
|
33
|
-
0xff,
|
|
34
|
-
0xff,
|
|
35
|
-
0xff,
|
|
36
|
-
0xff,
|
|
37
|
-
0xff,
|
|
38
|
-
0xff,
|
|
39
|
-
0xff,
|
|
40
|
-
0xff,
|
|
41
|
-
0xff,
|
|
42
|
-
0xff,
|
|
43
|
-
0xff,
|
|
44
|
-
0xff,
|
|
45
|
-
0xff,
|
|
46
|
-
0xff,
|
|
47
|
-
0xff,
|
|
48
|
-
0xff,
|
|
49
|
-
]);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
exports.MessagePower = MessagePower;
|
|
53
|
-
class MessageStart extends MessageDBBase {
|
|
54
|
-
constructor(device_protocol_version) {
|
|
55
|
-
super(device_protocol_version, MideaMessage_1.MessageType.SET, 0x02);
|
|
56
|
-
this.start = false;
|
|
57
|
-
this.washing_data = Buffer.alloc(0);
|
|
58
|
-
}
|
|
59
|
-
get _body() {
|
|
60
|
-
if (this.start) {
|
|
61
|
-
return Buffer.concat([Buffer.from([0xff, 0x01]), this.washing_data]);
|
|
62
|
-
}
|
|
63
|
-
else {
|
|
64
|
-
return Buffer.from([0xff, 0x00]);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
exports.MessageStart = MessageStart;
|
|
69
|
-
class DBGeneralMessageBody extends MideaMessage_1.MessageBody {
|
|
70
|
-
constructor(body) {
|
|
71
|
-
super(body);
|
|
72
|
-
this.power = body[1] > 0;
|
|
73
|
-
this.start = [0x2, 0x6].includes(body[2]);
|
|
74
|
-
this.washing_data = body.subarray(3, 16);
|
|
75
|
-
this.progress = 0;
|
|
76
|
-
this.time_remaining = 0;
|
|
77
|
-
for (let i = 0; i < 7; i++) {
|
|
78
|
-
if ((body[16] & (1 << i)) > 0) {
|
|
79
|
-
this.progress = i + 1;
|
|
80
|
-
break;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
if (this.power) {
|
|
84
|
-
this.time_remaining = body[17] + (body[18] << 8);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
this.time_remaining = undefined;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
exports.DBGeneralMessageBody = DBGeneralMessageBody;
|
|
92
|
-
class MessageDBResponse extends MideaMessage_1.MessageResponse {
|
|
93
|
-
constructor(message) {
|
|
94
|
-
super(message);
|
|
95
|
-
if ([MideaMessage_1.MessageType.QUERY, MideaMessage_1.MessageType.SET].includes(this.message_type) ||
|
|
96
|
-
(this.message_type === MideaMessage_1.MessageType.NOTIFY1 && this.body_type === 0x04)) {
|
|
97
|
-
this.set_body(new DBGeneralMessageBody(this.body));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
exports.MessageDBResponse = MessageDBResponse;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MessageDBResponse = exports.DBGeneralMessageBody = exports.MessageStart = exports.MessagePower = exports.MessageQuery = void 0;
|
|
4
|
+
const MideaConstants_1 = require("../../core/MideaConstants");
|
|
5
|
+
const MideaMessage_1 = require("../../core/MideaMessage");
|
|
6
|
+
class MessageDBBase extends MideaMessage_1.MessageRequest {
|
|
7
|
+
constructor(device_protocol_version, message_type, body_type) {
|
|
8
|
+
super(MideaConstants_1.DeviceType.FRONT_LOAD_WASHER, message_type, body_type, device_protocol_version);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
class MessageQuery extends MessageDBBase {
|
|
12
|
+
constructor(device_protocol_version) {
|
|
13
|
+
super(device_protocol_version, MideaMessage_1.MessageType.QUERY, 0x03);
|
|
14
|
+
}
|
|
15
|
+
get _body() {
|
|
16
|
+
return Buffer.alloc(0);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.MessageQuery = MessageQuery;
|
|
20
|
+
class MessagePower extends MessageDBBase {
|
|
21
|
+
constructor(device_protocol_version) {
|
|
22
|
+
super(device_protocol_version, MideaMessage_1.MessageType.SET, 0x02);
|
|
23
|
+
this.power = false;
|
|
24
|
+
}
|
|
25
|
+
get _body() {
|
|
26
|
+
const power = this.power ? 0x01 : 0x00;
|
|
27
|
+
return Buffer.from([
|
|
28
|
+
power,
|
|
29
|
+
0xff,
|
|
30
|
+
0xff,
|
|
31
|
+
0xff,
|
|
32
|
+
0xff,
|
|
33
|
+
0xff,
|
|
34
|
+
0xff,
|
|
35
|
+
0xff,
|
|
36
|
+
0xff,
|
|
37
|
+
0xff,
|
|
38
|
+
0xff,
|
|
39
|
+
0xff,
|
|
40
|
+
0xff,
|
|
41
|
+
0xff,
|
|
42
|
+
0xff,
|
|
43
|
+
0xff,
|
|
44
|
+
0xff,
|
|
45
|
+
0xff,
|
|
46
|
+
0xff,
|
|
47
|
+
0xff,
|
|
48
|
+
0xff,
|
|
49
|
+
]);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.MessagePower = MessagePower;
|
|
53
|
+
class MessageStart extends MessageDBBase {
|
|
54
|
+
constructor(device_protocol_version) {
|
|
55
|
+
super(device_protocol_version, MideaMessage_1.MessageType.SET, 0x02);
|
|
56
|
+
this.start = false;
|
|
57
|
+
this.washing_data = Buffer.alloc(0);
|
|
58
|
+
}
|
|
59
|
+
get _body() {
|
|
60
|
+
if (this.start) {
|
|
61
|
+
return Buffer.concat([Buffer.from([0xff, 0x01]), this.washing_data]);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
return Buffer.from([0xff, 0x00]);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
exports.MessageStart = MessageStart;
|
|
69
|
+
class DBGeneralMessageBody extends MideaMessage_1.MessageBody {
|
|
70
|
+
constructor(body) {
|
|
71
|
+
super(body);
|
|
72
|
+
this.power = body[1] > 0;
|
|
73
|
+
this.start = [0x2, 0x6].includes(body[2]);
|
|
74
|
+
this.washing_data = body.subarray(3, 16);
|
|
75
|
+
this.progress = 0;
|
|
76
|
+
this.time_remaining = 0;
|
|
77
|
+
for (let i = 0; i < 7; i++) {
|
|
78
|
+
if ((body[16] & (1 << i)) > 0) {
|
|
79
|
+
this.progress = i + 1;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
if (this.power) {
|
|
84
|
+
this.time_remaining = body[17] + (body[18] << 8);
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
this.time_remaining = undefined;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
exports.DBGeneralMessageBody = DBGeneralMessageBody;
|
|
92
|
+
class MessageDBResponse extends MideaMessage_1.MessageResponse {
|
|
93
|
+
constructor(message) {
|
|
94
|
+
super(message);
|
|
95
|
+
if ([MideaMessage_1.MessageType.QUERY, MideaMessage_1.MessageType.SET].includes(this.message_type) ||
|
|
96
|
+
(this.message_type === MideaMessage_1.MessageType.NOTIFY1 && this.body_type === 0x04)) {
|
|
97
|
+
this.set_body(new DBGeneralMessageBody(this.body));
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.MessageDBResponse = MessageDBResponse;
|
|
102
102
|
//# sourceMappingURL=MideaDBMessage.js.map
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/***********************************************************************
|
|
2
|
-
* Midea Dishwasher Device class
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2024 Kovalovszky Patrik, https://github.com/kovapatrik
|
|
5
|
-
*
|
|
6
|
-
* With thanks to https://github.com/georgezhao2010/midea_ac_lan
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
/// <reference types="node" />
|
|
10
|
-
import { Logger } from 'homebridge';
|
|
11
|
-
import MideaDevice, { DeviceAttributeBase } from '../../core/MideaDevice';
|
|
12
|
-
import { DeviceInfo } from '../../core/MideaConstants';
|
|
13
|
-
import { Config, DeviceConfig } from '../../platformUtils';
|
|
14
|
-
import { MessageQuery } from './MideaE1Message';
|
|
15
|
-
export interface E1Attributes extends DeviceAttributeBase {
|
|
16
|
-
POWER: boolean;
|
|
17
|
-
STATUS?: number;
|
|
18
|
-
MODE: number;
|
|
19
|
-
ADDITIONAL: number;
|
|
20
|
-
DOOR: boolean;
|
|
21
|
-
RINSE_AID: boolean;
|
|
22
|
-
SALT: boolean;
|
|
23
|
-
START_PAUSE: boolean;
|
|
24
|
-
START: boolean;
|
|
25
|
-
CHILD_LOCK: boolean;
|
|
26
|
-
UV: boolean;
|
|
27
|
-
DRY: boolean;
|
|
28
|
-
DRY_STATUS: boolean;
|
|
29
|
-
STORAGE: boolean;
|
|
30
|
-
STORAGE_STATUS: boolean;
|
|
31
|
-
TIME_REMAINING?: number;
|
|
32
|
-
PROGRESS?: number;
|
|
33
|
-
STORAGE_REMAINING?: number;
|
|
34
|
-
TEMPERATURE?: number;
|
|
35
|
-
HUMIDITY?: number;
|
|
36
|
-
WATERSWITCH: boolean;
|
|
37
|
-
WATER_LACK: boolean;
|
|
38
|
-
ERROR_CODE?: number;
|
|
39
|
-
SOFTWATER: number;
|
|
40
|
-
WRONG_OPERATION?: number;
|
|
41
|
-
BRIGHT?: number;
|
|
42
|
-
}
|
|
43
|
-
export default class MideaE1Device extends MideaDevice {
|
|
44
|
-
attributes: E1Attributes;
|
|
45
|
-
/*********************************************************************
|
|
46
|
-
* Constructor initializes all the attributes. We set some to invalid
|
|
47
|
-
* values so that they are detected as "changed" on the first status
|
|
48
|
-
* refresh... and passed back to the Homebridge/HomeKit accessory callback
|
|
49
|
-
* function to set their initial values.
|
|
50
|
-
*/
|
|
51
|
-
constructor(logger: Logger, device_info: DeviceInfo, config: Config, deviceConfig: DeviceConfig);
|
|
52
|
-
build_query(): MessageQuery[];
|
|
53
|
-
process_message(msg: Buffer): void;
|
|
54
|
-
set_attribute(attributes: Partial<E1Attributes>): Promise<void>;
|
|
55
|
-
protected set_subtype(): void;
|
|
56
|
-
}
|
|
1
|
+
/***********************************************************************
|
|
2
|
+
* Midea Dishwasher Device class
|
|
3
|
+
*
|
|
4
|
+
* Copyright (c) 2024 Kovalovszky Patrik, https://github.com/kovapatrik
|
|
5
|
+
*
|
|
6
|
+
* With thanks to https://github.com/georgezhao2010/midea_ac_lan
|
|
7
|
+
*
|
|
8
|
+
*/
|
|
9
|
+
/// <reference types="node" />
|
|
10
|
+
import { Logger } from 'homebridge';
|
|
11
|
+
import MideaDevice, { DeviceAttributeBase } from '../../core/MideaDevice';
|
|
12
|
+
import { DeviceInfo } from '../../core/MideaConstants';
|
|
13
|
+
import { Config, DeviceConfig } from '../../platformUtils';
|
|
14
|
+
import { MessageQuery } from './MideaE1Message';
|
|
15
|
+
export interface E1Attributes extends DeviceAttributeBase {
|
|
16
|
+
POWER: boolean;
|
|
17
|
+
STATUS?: number;
|
|
18
|
+
MODE: number;
|
|
19
|
+
ADDITIONAL: number;
|
|
20
|
+
DOOR: boolean;
|
|
21
|
+
RINSE_AID: boolean;
|
|
22
|
+
SALT: boolean;
|
|
23
|
+
START_PAUSE: boolean;
|
|
24
|
+
START: boolean;
|
|
25
|
+
CHILD_LOCK: boolean;
|
|
26
|
+
UV: boolean;
|
|
27
|
+
DRY: boolean;
|
|
28
|
+
DRY_STATUS: boolean;
|
|
29
|
+
STORAGE: boolean;
|
|
30
|
+
STORAGE_STATUS: boolean;
|
|
31
|
+
TIME_REMAINING?: number;
|
|
32
|
+
PROGRESS?: number;
|
|
33
|
+
STORAGE_REMAINING?: number;
|
|
34
|
+
TEMPERATURE?: number;
|
|
35
|
+
HUMIDITY?: number;
|
|
36
|
+
WATERSWITCH: boolean;
|
|
37
|
+
WATER_LACK: boolean;
|
|
38
|
+
ERROR_CODE?: number;
|
|
39
|
+
SOFTWATER: number;
|
|
40
|
+
WRONG_OPERATION?: number;
|
|
41
|
+
BRIGHT?: number;
|
|
42
|
+
}
|
|
43
|
+
export default class MideaE1Device extends MideaDevice {
|
|
44
|
+
attributes: E1Attributes;
|
|
45
|
+
/*********************************************************************
|
|
46
|
+
* Constructor initializes all the attributes. We set some to invalid
|
|
47
|
+
* values so that they are detected as "changed" on the first status
|
|
48
|
+
* refresh... and passed back to the Homebridge/HomeKit accessory callback
|
|
49
|
+
* function to set their initial values.
|
|
50
|
+
*/
|
|
51
|
+
constructor(logger: Logger, device_info: DeviceInfo, config: Config, deviceConfig: DeviceConfig);
|
|
52
|
+
build_query(): MessageQuery[];
|
|
53
|
+
process_message(msg: Buffer): void;
|
|
54
|
+
set_attribute(attributes: Partial<E1Attributes>): Promise<void>;
|
|
55
|
+
protected set_subtype(): void;
|
|
56
|
+
}
|
|
57
57
|
//# sourceMappingURL=MideaE1Device.d.ts.map
|
|
@@ -1,129 +1,129 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/***********************************************************************
|
|
3
|
-
* Midea Dishwasher Device class
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) 2024 Kovalovszky Patrik, https://github.com/kovapatrik
|
|
6
|
-
*
|
|
7
|
-
* With thanks to https://github.com/georgezhao2010/midea_ac_lan
|
|
8
|
-
*
|
|
9
|
-
*/
|
|
10
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
-
};
|
|
13
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
-
const MideaDevice_1 = __importDefault(require("../../core/MideaDevice"));
|
|
15
|
-
const MideaE1Message_1 = require("./MideaE1Message");
|
|
16
|
-
class MideaE1Device extends MideaDevice_1.default {
|
|
17
|
-
/*********************************************************************
|
|
18
|
-
* Constructor initializes all the attributes. We set some to invalid
|
|
19
|
-
* values so that they are detected as "changed" on the first status
|
|
20
|
-
* refresh... and passed back to the Homebridge/HomeKit accessory callback
|
|
21
|
-
* function to set their initial values.
|
|
22
|
-
*/
|
|
23
|
-
constructor(logger, device_info, config, deviceConfig) {
|
|
24
|
-
super(logger, device_info, config, deviceConfig);
|
|
25
|
-
this.attributes = {
|
|
26
|
-
POWER: false,
|
|
27
|
-
STATUS: undefined,
|
|
28
|
-
MODE: 0,
|
|
29
|
-
ADDITIONAL: 0,
|
|
30
|
-
DOOR: false,
|
|
31
|
-
RINSE_AID: false,
|
|
32
|
-
SALT: false,
|
|
33
|
-
START_PAUSE: false,
|
|
34
|
-
START: false,
|
|
35
|
-
CHILD_LOCK: false,
|
|
36
|
-
UV: false,
|
|
37
|
-
DRY: false,
|
|
38
|
-
DRY_STATUS: false,
|
|
39
|
-
STORAGE: false,
|
|
40
|
-
STORAGE_STATUS: false,
|
|
41
|
-
TIME_REMAINING: undefined,
|
|
42
|
-
PROGRESS: undefined,
|
|
43
|
-
STORAGE_REMAINING: undefined,
|
|
44
|
-
TEMPERATURE: undefined,
|
|
45
|
-
HUMIDITY: undefined,
|
|
46
|
-
WATERSWITCH: false,
|
|
47
|
-
WATER_LACK: false,
|
|
48
|
-
ERROR_CODE: undefined,
|
|
49
|
-
SOFTWATER: 0,
|
|
50
|
-
WRONG_OPERATION: undefined,
|
|
51
|
-
BRIGHT: undefined,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
build_query() {
|
|
55
|
-
return [new MideaE1Message_1.MessageQuery(this.device_protocol_version)];
|
|
56
|
-
}
|
|
57
|
-
process_message(msg) {
|
|
58
|
-
const message = new MideaE1Message_1.MessageE1Response(msg);
|
|
59
|
-
if (this.verbose) {
|
|
60
|
-
this.logger.debug(`[${this.name}] Body:\n${JSON.stringify(message.body)}`);
|
|
61
|
-
}
|
|
62
|
-
const changed = {};
|
|
63
|
-
for (const status of Object.keys(this.attributes)) {
|
|
64
|
-
const value = message.get_body_attribute(status.toLowerCase());
|
|
65
|
-
if (value !== undefined) {
|
|
66
|
-
if (this.attributes[status] !== value) {
|
|
67
|
-
// Track only those attributes that change value. So when we send to the Homebridge /
|
|
68
|
-
// HomeKit accessory we only update values that change. First time through this
|
|
69
|
-
// should be most/all attributes having initialized them to invalid values.
|
|
70
|
-
this.logger.debug(`[${this.name}] Value for ${status} changed from '${this.attributes[status]}' to '${value}'`);
|
|
71
|
-
changed[status] = value;
|
|
72
|
-
}
|
|
73
|
-
this.attributes[status] = value;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// Now we update Homebridge / Homekit accessory
|
|
77
|
-
if (Object.keys(changed).length > 0) {
|
|
78
|
-
this.update(changed);
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
this.logger.debug(`[${this.name}] Status unchanged`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
async set_attribute(attributes) {
|
|
85
|
-
var _a, _b, _c;
|
|
86
|
-
const messageToSend = {
|
|
87
|
-
POWER: undefined,
|
|
88
|
-
CHILD_LOCK: undefined,
|
|
89
|
-
STORAGE: undefined,
|
|
90
|
-
};
|
|
91
|
-
try {
|
|
92
|
-
for (const [k, v] of Object.entries(attributes)) {
|
|
93
|
-
if (v === this.attributes[k]) {
|
|
94
|
-
this.logger.info(`[${this.name}] Attribute ${k} already set to ${v}`);
|
|
95
|
-
continue;
|
|
96
|
-
}
|
|
97
|
-
this.logger.info(`[${this.name}] Set device attribute ${k} to: ${v}`);
|
|
98
|
-
this.attributes[k] = v;
|
|
99
|
-
if (k === 'POWER') {
|
|
100
|
-
|
|
101
|
-
messageToSend.POWER.power = v;
|
|
102
|
-
}
|
|
103
|
-
else if (k === 'CHILD_LOCK') {
|
|
104
|
-
|
|
105
|
-
messageToSend.CHILD_LOCK.lock = v;
|
|
106
|
-
}
|
|
107
|
-
else if (k === 'STORAGE') {
|
|
108
|
-
|
|
109
|
-
messageToSend.STORAGE.storage = v;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
for (const [k, v] of Object.entries(messageToSend)) {
|
|
113
|
-
if (v !== undefined) {
|
|
114
|
-
this.logger.debug(`[${this.name}] Set message ${k}:\n${JSON.stringify(v)}`);
|
|
115
|
-
await this.build_send(v);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
catch (err) {
|
|
120
|
-
const msg = err instanceof Error ? err.stack : err;
|
|
121
|
-
this.logger.debug(`[${this.name}] Error in set_attribute (${this.ip}:${this.port}):\n${msg}`);
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
set_subtype() {
|
|
125
|
-
this.logger.debug('No subtype for E1 device');
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
exports.default = MideaE1Device;
|
|
1
|
+
"use strict";
|
|
2
|
+
/***********************************************************************
|
|
3
|
+
* Midea Dishwasher Device class
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) 2024 Kovalovszky Patrik, https://github.com/kovapatrik
|
|
6
|
+
*
|
|
7
|
+
* With thanks to https://github.com/georgezhao2010/midea_ac_lan
|
|
8
|
+
*
|
|
9
|
+
*/
|
|
10
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
11
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
const MideaDevice_1 = __importDefault(require("../../core/MideaDevice"));
|
|
15
|
+
const MideaE1Message_1 = require("./MideaE1Message");
|
|
16
|
+
class MideaE1Device extends MideaDevice_1.default {
|
|
17
|
+
/*********************************************************************
|
|
18
|
+
* Constructor initializes all the attributes. We set some to invalid
|
|
19
|
+
* values so that they are detected as "changed" on the first status
|
|
20
|
+
* refresh... and passed back to the Homebridge/HomeKit accessory callback
|
|
21
|
+
* function to set their initial values.
|
|
22
|
+
*/
|
|
23
|
+
constructor(logger, device_info, config, deviceConfig) {
|
|
24
|
+
super(logger, device_info, config, deviceConfig);
|
|
25
|
+
this.attributes = {
|
|
26
|
+
POWER: false,
|
|
27
|
+
STATUS: undefined,
|
|
28
|
+
MODE: 0,
|
|
29
|
+
ADDITIONAL: 0,
|
|
30
|
+
DOOR: false,
|
|
31
|
+
RINSE_AID: false,
|
|
32
|
+
SALT: false,
|
|
33
|
+
START_PAUSE: false,
|
|
34
|
+
START: false,
|
|
35
|
+
CHILD_LOCK: false,
|
|
36
|
+
UV: false,
|
|
37
|
+
DRY: false,
|
|
38
|
+
DRY_STATUS: false,
|
|
39
|
+
STORAGE: false,
|
|
40
|
+
STORAGE_STATUS: false,
|
|
41
|
+
TIME_REMAINING: undefined,
|
|
42
|
+
PROGRESS: undefined,
|
|
43
|
+
STORAGE_REMAINING: undefined,
|
|
44
|
+
TEMPERATURE: undefined,
|
|
45
|
+
HUMIDITY: undefined,
|
|
46
|
+
WATERSWITCH: false,
|
|
47
|
+
WATER_LACK: false,
|
|
48
|
+
ERROR_CODE: undefined,
|
|
49
|
+
SOFTWATER: 0,
|
|
50
|
+
WRONG_OPERATION: undefined,
|
|
51
|
+
BRIGHT: undefined,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
build_query() {
|
|
55
|
+
return [new MideaE1Message_1.MessageQuery(this.device_protocol_version)];
|
|
56
|
+
}
|
|
57
|
+
process_message(msg) {
|
|
58
|
+
const message = new MideaE1Message_1.MessageE1Response(msg);
|
|
59
|
+
if (this.verbose) {
|
|
60
|
+
this.logger.debug(`[${this.name}] Body:\n${JSON.stringify(message.body)}`);
|
|
61
|
+
}
|
|
62
|
+
const changed = {};
|
|
63
|
+
for (const status of Object.keys(this.attributes)) {
|
|
64
|
+
const value = message.get_body_attribute(status.toLowerCase());
|
|
65
|
+
if (value !== undefined) {
|
|
66
|
+
if (this.attributes[status] !== value) {
|
|
67
|
+
// Track only those attributes that change value. So when we send to the Homebridge /
|
|
68
|
+
// HomeKit accessory we only update values that change. First time through this
|
|
69
|
+
// should be most/all attributes having initialized them to invalid values.
|
|
70
|
+
this.logger.debug(`[${this.name}] Value for ${status} changed from '${this.attributes[status]}' to '${value}'`);
|
|
71
|
+
changed[status] = value;
|
|
72
|
+
}
|
|
73
|
+
this.attributes[status] = value;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
// Now we update Homebridge / Homekit accessory
|
|
77
|
+
if (Object.keys(changed).length > 0) {
|
|
78
|
+
this.update(changed);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
this.logger.debug(`[${this.name}] Status unchanged`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
async set_attribute(attributes) {
|
|
85
|
+
var _a, _b, _c;
|
|
86
|
+
const messageToSend = {
|
|
87
|
+
POWER: undefined,
|
|
88
|
+
CHILD_LOCK: undefined,
|
|
89
|
+
STORAGE: undefined,
|
|
90
|
+
};
|
|
91
|
+
try {
|
|
92
|
+
for (const [k, v] of Object.entries(attributes)) {
|
|
93
|
+
if (v === this.attributes[k]) {
|
|
94
|
+
this.logger.info(`[${this.name}] Attribute ${k} already set to ${v}`);
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
this.logger.info(`[${this.name}] Set device attribute ${k} to: ${v}`);
|
|
98
|
+
this.attributes[k] = v;
|
|
99
|
+
if (k === 'POWER') {
|
|
100
|
+
(_a = messageToSend.POWER) !== null && _a !== void 0 ? _a : (messageToSend.POWER = new MideaE1Message_1.MessagePower(this.device_protocol_version));
|
|
101
|
+
messageToSend.POWER.power = v;
|
|
102
|
+
}
|
|
103
|
+
else if (k === 'CHILD_LOCK') {
|
|
104
|
+
(_b = messageToSend.CHILD_LOCK) !== null && _b !== void 0 ? _b : (messageToSend.CHILD_LOCK = new MideaE1Message_1.MessageLock(this.device_protocol_version));
|
|
105
|
+
messageToSend.CHILD_LOCK.lock = v;
|
|
106
|
+
}
|
|
107
|
+
else if (k === 'STORAGE') {
|
|
108
|
+
(_c = messageToSend.STORAGE) !== null && _c !== void 0 ? _c : (messageToSend.STORAGE = new MideaE1Message_1.MessageStorage(this.device_protocol_version));
|
|
109
|
+
messageToSend.STORAGE.storage = v;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
for (const [k, v] of Object.entries(messageToSend)) {
|
|
113
|
+
if (v !== undefined) {
|
|
114
|
+
this.logger.debug(`[${this.name}] Set message ${k}:\n${JSON.stringify(v)}`);
|
|
115
|
+
await this.build_send(v);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
catch (err) {
|
|
120
|
+
const msg = err instanceof Error ? err.stack : err;
|
|
121
|
+
this.logger.debug(`[${this.name}] Error in set_attribute (${this.ip}:${this.port}):\n${msg}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
set_subtype() {
|
|
125
|
+
this.logger.debug('No subtype for E1 device');
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
exports.default = MideaE1Device;
|
|
129
129
|
//# sourceMappingURL=MideaE1Device.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MideaE1Device.js","sourceRoot":"","sources":["../../../src/devices/e1/MideaE1Device.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;;;AAGH,yEAA0E;AAG1E,qDAA8G;AAiC9G,MAAqB,aAAc,SAAQ,qBAAW;IAGpD;;;;;OAKG;IACH,YAAY,MAAc,EAAE,WAAuB,EAAE,MAAc,EAAE,YAA0B;QAC7F,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QAEjD,IAAI,CAAC,UAAU,GAAG;YAChB,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,SAAS;YACjB,IAAI,EAAE,CA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O,CAAC,aAAa,CAAC,EAAE;gBAClD,IAAI,CAAC,KAAK,SAAS,EAAE;oBACnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,iBAAiB,CAAC,MAAM,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;oBAC5E,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;iBAC1B;aACF;SACF;QAAC,OAAO,GAAG,EAAE;YACZ,MAAM,GAAG,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC;YACnD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,6BAA6B,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,IAAI,OAAO,GAAG,EAAE,CAAC,CAAC;SAC/F;IACH,CAAC;IAES,WAAW;QACnB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;IAChD,CAAC;CACF;AAzHD,gCAyHC"}
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { MessageRequest, MessageResponse, MessageType } from '../../core/MideaMessage';
|
|
3
|
-
declare abstract class MessageE1Base extends MessageRequest {
|
|
4
|
-
constructor(device_protocol_version: number, message_type: MessageType, body_type: number);
|
|
5
|
-
}
|
|
6
|
-
export declare class MessagePower extends MessageE1Base {
|
|
7
|
-
power: boolean;
|
|
8
|
-
constructor(device_protocol_version: number);
|
|
9
|
-
get _body(): Buffer;
|
|
10
|
-
}
|
|
11
|
-
export declare class MessageLock extends MessageE1Base {
|
|
12
|
-
lock: boolean;
|
|
13
|
-
constructor(device_protocol_version: number);
|
|
14
|
-
get _body(): Buffer;
|
|
15
|
-
}
|
|
16
|
-
export declare class MessageStorage extends MessageE1Base {
|
|
17
|
-
storage: boolean;
|
|
18
|
-
constructor(device_protocol_version: number);
|
|
19
|
-
get _body(): Buffer;
|
|
20
|
-
}
|
|
21
|
-
export declare class MessageQuery extends MessageE1Base {
|
|
22
|
-
constructor(device_protocol_version: number);
|
|
23
|
-
get _body(): Buffer;
|
|
24
|
-
}
|
|
25
|
-
export declare class MessageE1Response extends MessageResponse {
|
|
26
|
-
constructor(message: Buffer);
|
|
27
|
-
}
|
|
28
|
-
export {};
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { MessageRequest, MessageResponse, MessageType } from '../../core/MideaMessage';
|
|
3
|
+
declare abstract class MessageE1Base extends MessageRequest {
|
|
4
|
+
constructor(device_protocol_version: number, message_type: MessageType, body_type: number);
|
|
5
|
+
}
|
|
6
|
+
export declare class MessagePower extends MessageE1Base {
|
|
7
|
+
power: boolean;
|
|
8
|
+
constructor(device_protocol_version: number);
|
|
9
|
+
get _body(): Buffer;
|
|
10
|
+
}
|
|
11
|
+
export declare class MessageLock extends MessageE1Base {
|
|
12
|
+
lock: boolean;
|
|
13
|
+
constructor(device_protocol_version: number);
|
|
14
|
+
get _body(): Buffer;
|
|
15
|
+
}
|
|
16
|
+
export declare class MessageStorage extends MessageE1Base {
|
|
17
|
+
storage: boolean;
|
|
18
|
+
constructor(device_protocol_version: number);
|
|
19
|
+
get _body(): Buffer;
|
|
20
|
+
}
|
|
21
|
+
export declare class MessageQuery extends MessageE1Base {
|
|
22
|
+
constructor(device_protocol_version: number);
|
|
23
|
+
get _body(): Buffer;
|
|
24
|
+
}
|
|
25
|
+
export declare class MessageE1Response extends MessageResponse {
|
|
26
|
+
constructor(message: Buffer);
|
|
27
|
+
}
|
|
28
|
+
export {};
|
|
29
29
|
//# sourceMappingURL=MideaE1Message.d.ts.map
|