homebridge-midea-platform 1.2.0-beta.7 → 1.2.1
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/CHANGELOG.md +7 -2
- package/README.md +2 -2
- package/config.schema.json +1 -1
- package/dist/accessory/AccessoryFactory.d.ts +14 -15
- package/dist/accessory/AccessoryFactory.js +34 -40
- package/dist/accessory/AccessoryFactory.js.map +1 -1
- package/dist/accessory/AirConditionerAccessory.d.ts +98 -99
- package/dist/accessory/AirConditionerAccessory.js +666 -662
- package/dist/accessory/AirConditionerAccessory.js.map +1 -1
- package/dist/accessory/BaseAccessory.d.ts +11 -12
- package/dist/accessory/BaseAccessory.js +21 -21
- package/dist/accessory/BaseAccessory.js.map +1 -1
- package/dist/accessory/DehumidifierAccessory.d.ts +45 -46
- package/dist/accessory/DehumidifierAccessory.js +343 -344
- package/dist/accessory/DehumidifierAccessory.js.map +1 -1
- package/dist/accessory/DishwasherAccessory.d.ts +30 -31
- package/dist/accessory/DishwasherAccessory.js +59 -63
- package/dist/accessory/DishwasherAccessory.js.map +1 -1
- package/dist/accessory/ElectricWaterHeaterAccessory.d.ts +44 -45
- package/dist/accessory/ElectricWaterHeaterAccessory.js +172 -176
- package/dist/accessory/ElectricWaterHeaterAccessory.js.map +1 -1
- package/dist/accessory/FanAccessory.d.ts +39 -40
- package/dist/accessory/FanAccessory.js +120 -123
- package/dist/accessory/FanAccessory.js.map +1 -1
- package/dist/accessory/FrontLoadWasherAccessory.d.ts +30 -31
- package/dist/accessory/FrontLoadWasherAccessory.js +63 -66
- package/dist/accessory/FrontLoadWasherAccessory.js.map +1 -1
- package/dist/accessory/GasWaterHeaterAccessory.d.ts +51 -52
- package/dist/accessory/GasWaterHeaterAccessory.js +217 -216
- package/dist/accessory/GasWaterHeaterAccessory.js.map +1 -1
- package/dist/accessory/{HeatPumpWifiControllerAccessory.d.ts → HeatPumpWiFiControllerAccessory.d.ts} +34 -35
- package/dist/accessory/{HeatPumpWifiControllerAccessory.js → HeatPumpWiFiControllerAccessory.js} +55 -36
- package/dist/accessory/HeatPumpWiFiControllerAccessory.js.map +1 -0
- package/dist/core/MideaCloud.d.ts +34 -36
- package/dist/core/MideaCloud.js +349 -350
- package/dist/core/MideaCloud.js.map +1 -1
- package/dist/core/MideaConstants.d.ts +51 -52
- package/dist/core/MideaConstants.js +56 -59
- package/dist/core/MideaConstants.js.map +1 -1
- package/dist/core/MideaDevice.d.ts +75 -78
- package/dist/core/MideaDevice.js +430 -420
- package/dist/core/MideaDevice.js.map +1 -1
- package/dist/core/MideaDiscover.d.ts +34 -36
- package/dist/core/MideaDiscover.js +208 -212
- package/dist/core/MideaDiscover.js.map +1 -1
- package/dist/core/MideaMessage.d.ts +75 -76
- package/dist/core/MideaMessage.js +185 -184
- package/dist/core/MideaMessage.js.map +1 -1
- package/dist/core/MideaPacketBuilder.d.ts +9 -11
- package/dist/core/MideaPacketBuilder.js +60 -60
- package/dist/core/MideaPacketBuilder.js.map +1 -1
- package/dist/core/MideaSecurity.d.ts +62 -64
- package/dist/core/MideaSecurity.js +241 -251
- package/dist/core/MideaSecurity.js.map +1 -1
- package/dist/core/MideaUtils.d.ts +31 -33
- package/dist/core/MideaUtils.js +178 -181
- package/dist/core/MideaUtils.js.map +1 -1
- package/dist/devices/DeviceFactory.d.ts +14 -15
- package/dist/devices/DeviceFactory.js +34 -40
- package/dist/devices/DeviceFactory.js.map +1 -1
- package/dist/devices/a1/MideaA1Device.d.ts +75 -77
- package/dist/devices/a1/MideaA1Device.js +142 -145
- package/dist/devices/a1/MideaA1Device.js.map +1 -1
- package/dist/devices/a1/MideaA1Message.d.ts +39 -41
- package/dist/devices/a1/MideaA1Message.js +219 -198
- package/dist/devices/a1/MideaA1Message.js.map +1 -1
- package/dist/devices/ac/MideaACDevice.d.ts +105 -107
- package/dist/devices/ac/MideaACDevice.js +417 -400
- package/dist/devices/ac/MideaACDevice.js.map +1 -1
- package/dist/devices/ac/MideaACMessage.d.ts +97 -96
- package/dist/devices/ac/MideaACMessage.js +724 -621
- package/dist/devices/ac/MideaACMessage.js.map +1 -1
- package/dist/devices/c3/MideaC3Device.d.ts +73 -75
- package/dist/devices/c3/MideaC3Device.js +249 -255
- package/dist/devices/c3/MideaC3Device.js.map +1 -1
- package/dist/devices/c3/MideaC3Message.d.ts +81 -80
- package/dist/devices/c3/MideaC3Message.js +190 -152
- package/dist/devices/c3/MideaC3Message.js.map +1 -1
- package/dist/devices/db/MideaDBDevice.d.ts +28 -30
- package/dist/devices/db/MideaDBDevice.js +94 -100
- package/dist/devices/db/MideaDBDevice.js.map +1 -1
- package/dist/devices/db/MideaDBMessage.d.ts +31 -33
- package/dist/devices/db/MideaDBMessage.js +101 -101
- package/dist/devices/db/MideaDBMessage.js.map +1 -1
- package/dist/devices/e1/MideaE1Device.d.ts +55 -57
- package/dist/devices/e1/MideaE1Device.js +122 -128
- package/dist/devices/e1/MideaE1Device.js.map +1 -1
- package/dist/devices/e1/MideaE1Message.d.ts +27 -29
- package/dist/devices/e1/MideaE1Message.js +128 -107
- package/dist/devices/e1/MideaE1Message.js.map +1 -1
- package/dist/devices/e2/MideaE2Device.d.ts +43 -45
- package/dist/devices/e2/MideaE2Device.js +124 -129
- package/dist/devices/e2/MideaE2Device.js.map +1 -1
- package/dist/devices/e2/MideaE2Message.d.ts +34 -34
- package/dist/devices/e2/MideaE2Message.js +143 -132
- package/dist/devices/e2/MideaE2Message.js.map +1 -1
- package/dist/devices/e3/MideaE3Device.d.ts +42 -44
- package/dist/devices/e3/MideaE3Device.js +132 -137
- package/dist/devices/e3/MideaE3Device.js.map +1 -1
- package/dist/devices/e3/MideaE3Message.d.ts +51 -52
- package/dist/devices/e3/MideaE3Message.js +144 -136
- package/dist/devices/e3/MideaE3Message.js.map +1 -1
- package/dist/devices/fa/MideaFADevice.d.ts +35 -37
- package/dist/devices/fa/MideaFADevice.js +102 -106
- package/dist/devices/fa/MideaFADevice.js.map +1 -1
- package/dist/devices/fa/MideaFAMessage.d.ts +38 -39
- package/dist/devices/fa/MideaFAMessage.js +108 -98
- package/dist/devices/fa/MideaFAMessage.js.map +1 -1
- package/dist/index.d.ts +6 -7
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/platform.d.ts +61 -61
- package/dist/platform.js +232 -212
- package/dist/platform.js.map +1 -1
- package/dist/platformUtils.d.ts +116 -117
- package/dist/platformUtils.js +107 -110
- package/dist/platformUtils.js.map +1 -1
- package/dist/settings.d.ts +8 -9
- package/dist/settings.js +8 -11
- package/dist/settings.js.map +1 -1
- package/docs/download_lua.md +9 -0
- package/eslint.config.js +43 -0
- package/homebridge-ui/public/js/bootstrap.min.js +1179 -1
- package/homebridge-ui/{server.js → server.cjs} +30 -30
- package/package.json +21 -31
- package/.eslintignore +0 -3
- package/.husky/pre-commit +0 -5
- package/.prettierrc +0 -19
- package/dist/accessory/AccessoryFactory.d.ts.map +0 -1
- package/dist/accessory/AirConditionerAccessory.d.ts.map +0 -1
- package/dist/accessory/BaseAccessory.d.ts.map +0 -1
- package/dist/accessory/DehumidifierAccessory.d.ts.map +0 -1
- package/dist/accessory/DishwasherAccessory.d.ts.map +0 -1
- package/dist/accessory/ElectricWaterHeaterAccessory.d.ts.map +0 -1
- package/dist/accessory/FanAccessory.d.ts.map +0 -1
- package/dist/accessory/FrontLoadWasherAccessory.d.ts.map +0 -1
- package/dist/accessory/GasWaterHeaterAccessory.d.ts.map +0 -1
- package/dist/accessory/HeatPumpWifiControllerAccessory.d.ts.map +0 -1
- package/dist/accessory/HeatPumpWifiControllerAccessory.js.map +0 -1
- package/dist/core/MideaCloud.d.ts.map +0 -1
- package/dist/core/MideaConstants.d.ts.map +0 -1
- package/dist/core/MideaDevice.d.ts.map +0 -1
- package/dist/core/MideaDiscover.d.ts.map +0 -1
- package/dist/core/MideaMessage.d.ts.map +0 -1
- package/dist/core/MideaPacketBuilder.d.ts.map +0 -1
- package/dist/core/MideaSecurity.d.ts.map +0 -1
- package/dist/core/MideaUtils.d.ts.map +0 -1
- package/dist/devices/DeviceFactory.d.ts.map +0 -1
- package/dist/devices/a1/MideaA1Device.d.ts.map +0 -1
- package/dist/devices/a1/MideaA1Message.d.ts.map +0 -1
- package/dist/devices/ac/MideaACDevice.d.ts.map +0 -1
- package/dist/devices/ac/MideaACMessage.d.ts.map +0 -1
- package/dist/devices/c3/MideaC3Device.d.ts.map +0 -1
- package/dist/devices/c3/MideaC3Message.d.ts.map +0 -1
- package/dist/devices/db/MideaDBDevice.d.ts.map +0 -1
- package/dist/devices/db/MideaDBMessage.d.ts.map +0 -1
- package/dist/devices/e1/MideaE1Device.d.ts.map +0 -1
- package/dist/devices/e1/MideaE1Message.d.ts.map +0 -1
- package/dist/devices/e2/MideaE2Device.d.ts.map +0 -1
- package/dist/devices/e2/MideaE2Message.d.ts.map +0 -1
- package/dist/devices/e3/MideaE3Device.d.ts.map +0 -1
- package/dist/devices/e3/MideaE3Message.d.ts.map +0 -1
- package/dist/devices/fa/MideaFADevice.d.ts.map +0 -1
- package/dist/devices/fa/MideaFAMessage.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/platform.d.ts.map +0 -1
- package/dist/platformUtils.d.ts.map +0 -1
- package/dist/settings.d.ts.map +0 -1
|
@@ -1,138 +1,133 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
this._precision_halves
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
return this.
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
this.
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
message.
|
|
77
|
-
message.
|
|
78
|
-
message
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
if (
|
|
107
|
-
|
|
108
|
-
messageToSend.
|
|
109
|
-
}
|
|
110
|
-
else
|
|
111
|
-
|
|
112
|
-
messageToSend.
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
set_subtype() {
|
|
134
|
-
this.logger.debug('No subtype for E3 device');
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
exports.default = MideaE3Device;
|
|
1
|
+
/***********************************************************************
|
|
2
|
+
* Midea Gas Water Heater 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
|
+
import MideaDevice from '../../core/MideaDevice.js';
|
|
10
|
+
import { MessageE3Response, MessageNewProtocolSet, MessagePower, MessageQuery, MessageSet } from './MideaE3Message.js';
|
|
11
|
+
export default class MideaE3Device extends MideaDevice {
|
|
12
|
+
attributes;
|
|
13
|
+
_old_subtypes = [32, 33, 34, 35, 36, 37, 40, 43, 48, 49, 80];
|
|
14
|
+
_precision_halves;
|
|
15
|
+
/*********************************************************************
|
|
16
|
+
* Constructor initializes all the attributes. We set some to invalid
|
|
17
|
+
* values so that they are detected as "changed" on the first status
|
|
18
|
+
* refresh... and passed back to the Homebridge/HomeKit accessory callback
|
|
19
|
+
* function to set their initial values.
|
|
20
|
+
*/
|
|
21
|
+
constructor(logger, device_info, config, deviceConfig) {
|
|
22
|
+
super(logger, device_info, config, deviceConfig);
|
|
23
|
+
this.attributes = {
|
|
24
|
+
POWER: false,
|
|
25
|
+
BURNING_STATE: false,
|
|
26
|
+
ZERO_COLD_WATER: false,
|
|
27
|
+
PROTECTION: false,
|
|
28
|
+
ZERO_COLD_PULSE: false,
|
|
29
|
+
SMART_VOLUME: false,
|
|
30
|
+
CURRENT_TEMPERATURE: undefined,
|
|
31
|
+
TARGET_TEMPERATURE: 40,
|
|
32
|
+
};
|
|
33
|
+
this._precision_halves = deviceConfig.E3_options.precisionHalves;
|
|
34
|
+
}
|
|
35
|
+
get precision_halves() {
|
|
36
|
+
return this._precision_halves;
|
|
37
|
+
}
|
|
38
|
+
build_query() {
|
|
39
|
+
return [new MessageQuery(this.device_protocol_version)];
|
|
40
|
+
}
|
|
41
|
+
process_message(msg) {
|
|
42
|
+
const message = new MessageE3Response(msg);
|
|
43
|
+
if (this.verbose) {
|
|
44
|
+
this.logger.debug(`[${this.name}] Body:\n${JSON.stringify(message.body)}`);
|
|
45
|
+
}
|
|
46
|
+
const changed = {};
|
|
47
|
+
for (const status of Object.keys(this.attributes)) {
|
|
48
|
+
let value = message.get_body_attribute(status.toLowerCase());
|
|
49
|
+
if (value !== undefined) {
|
|
50
|
+
if (this.attributes[status] !== value) {
|
|
51
|
+
// Track only those attributes that change value. So when we send to the Homebridge /
|
|
52
|
+
// HomeKit accessory we only update values that change. First time through this
|
|
53
|
+
// should be most/all attributes having initialized them to invalid values.
|
|
54
|
+
if (this.precision_halves && ['CURRENT_TEMPERATURE', 'TARGET_TEMPERATURE'].includes(status)) {
|
|
55
|
+
value = value / 2;
|
|
56
|
+
}
|
|
57
|
+
this.logger.debug(`[${this.name}] Value for ${status} changed from '${this.attributes[status]}' to '${value}'`);
|
|
58
|
+
changed[status] = value;
|
|
59
|
+
}
|
|
60
|
+
this.attributes[status] = value;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// Now we update Homebridge / Homekit accessory
|
|
64
|
+
if (Object.keys(changed).length > 0) {
|
|
65
|
+
this.update(changed);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.logger.debug(`[${this.name}] Status unchanged`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
make_message_set() {
|
|
72
|
+
const message = new MessageSet(this.device_protocol_version);
|
|
73
|
+
message.zero_cold_water = this.attributes.ZERO_COLD_WATER;
|
|
74
|
+
message.protection = this.attributes.PROTECTION;
|
|
75
|
+
message.zero_cold_pulse = this.attributes.ZERO_COLD_PULSE;
|
|
76
|
+
message.smart_volume = this.attributes.SMART_VOLUME;
|
|
77
|
+
message.target_temperature = this.attributes.TARGET_TEMPERATURE;
|
|
78
|
+
return message;
|
|
79
|
+
}
|
|
80
|
+
async set_attribute(attributes) {
|
|
81
|
+
const messageToSend = {
|
|
82
|
+
POWER: undefined,
|
|
83
|
+
SET: undefined,
|
|
84
|
+
NEW_PROTOCOL_SET: undefined,
|
|
85
|
+
};
|
|
86
|
+
try {
|
|
87
|
+
for (const [k, v] of Object.entries(attributes)) {
|
|
88
|
+
if (v === this.attributes[k]) {
|
|
89
|
+
this.logger.info(`[${this.name}] Attribute ${k} already set to ${v}`);
|
|
90
|
+
continue;
|
|
91
|
+
}
|
|
92
|
+
this.logger.info(`[${this.name}] Set device attribute ${k} to: ${v}`);
|
|
93
|
+
if (this.precision_halves && k === 'TARGET_TEMPERATURE') {
|
|
94
|
+
const value = (v * 2) | 0;
|
|
95
|
+
this.attributes[k] = value;
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
this.attributes[k] = v;
|
|
99
|
+
}
|
|
100
|
+
// not sensor data
|
|
101
|
+
if (!['BURNING_STATE', 'CURRENT_TEMPERATURE', 'PROTECTION'].includes(k)) {
|
|
102
|
+
if (k === 'POWER') {
|
|
103
|
+
messageToSend.POWER ??= new MessagePower(this.device_protocol_version);
|
|
104
|
+
messageToSend.POWER.power = v;
|
|
105
|
+
}
|
|
106
|
+
else if (this._old_subtypes.includes(this.sub_type)) {
|
|
107
|
+
messageToSend.SET ??= this.make_message_set();
|
|
108
|
+
messageToSend.SET[k.toLowerCase()] = v;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
messageToSend.NEW_PROTOCOL_SET ??= new MessageNewProtocolSet(this.device_protocol_version);
|
|
112
|
+
messageToSend.NEW_PROTOCOL_SET.key = k;
|
|
113
|
+
messageToSend.NEW_PROTOCOL_SET.value = v;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
for (const [k, v] of Object.entries(messageToSend)) {
|
|
118
|
+
if (v !== undefined) {
|
|
119
|
+
this.logger.debug(`[${this.name}] Set message ${k}:\n${JSON.stringify(v)}`);
|
|
120
|
+
await this.build_send(v);
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
catch (err) {
|
|
125
|
+
const msg = err instanceof Error ? err.stack : err;
|
|
126
|
+
this.logger.debug(`[${this.name}] Error in set_attribute (${this.ip}:${this.port}):\n${msg}`);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
set_subtype() {
|
|
130
|
+
this.logger.debug('No subtype for E3 device');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
138
133
|
//# sourceMappingURL=MideaE3Device.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MideaE3Device.js","sourceRoot":"","sources":["../../../src/devices/e3/MideaE3Device.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MideaE3Device.js","sourceRoot":"","sources":["../../../src/devices/e3/MideaE3Device.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,WAAoC,MAAM,2BAA2B,CAAC;AAI7E,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAmB,MAAM,qBAAqB,CAAC;AAexI,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,WAAW;IAC7C,UAAU,CAAe;IAExB,aAAa,GAAG,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAC7D,iBAAiB,CAAU;IAEnC;;;;;OAKG;IACH,YAAY,MAAc,EAAE,WAAuB,EAAE,MAAc,EAAE,YAA0B;QAC7F,KAAK,CAAC,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU,GAAG;YAChB,KAAK,EAAE,KAAK;YACZ,aAAa,EAAE,KAAK;YACp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
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
target_temperature: number;
|
|
23
|
-
zero_cold_water: boolean;
|
|
24
|
-
bathtub_volume: number;
|
|
25
|
-
protection: boolean;
|
|
26
|
-
zero_cold_pulse: boolean;
|
|
27
|
-
smart_volume: boolean;
|
|
28
|
-
constructor(device_protocol_version: number);
|
|
29
|
-
get _body(): Buffer;
|
|
30
|
-
}
|
|
31
|
-
export declare class MessageNewProtocolSet extends MessageE3Base {
|
|
32
|
-
key?: keyof typeof NewProtocolTags;
|
|
33
|
-
value?: number | boolean;
|
|
34
|
-
constructor(device_protocol_version: number);
|
|
35
|
-
get _body(): Buffer;
|
|
36
|
-
}
|
|
37
|
-
export declare class E3GeneralMessageBody extends MessageBody {
|
|
38
|
-
power: boolean;
|
|
39
|
-
burning_state: boolean;
|
|
40
|
-
zero_cold_water: boolean;
|
|
41
|
-
current_temperature: number;
|
|
42
|
-
target_temperature: number;
|
|
43
|
-
protection: boolean;
|
|
44
|
-
zero_cold_pulse: boolean;
|
|
45
|
-
smart_volume: boolean;
|
|
46
|
-
constructor(body: Buffer);
|
|
47
|
-
}
|
|
48
|
-
export declare class MessageE3Response extends MessageResponse {
|
|
49
|
-
constructor(message: Buffer);
|
|
50
|
-
}
|
|
51
|
-
export {};
|
|
52
|
-
//# sourceMappingURL=MideaE3Message.d.ts.map
|
|
1
|
+
import { MessageBody, MessageRequest, MessageResponse, MessageType } from '../../core/MideaMessage.js';
|
|
2
|
+
export declare enum NewProtocolTags {
|
|
3
|
+
ZERO_COLD_WATER = 3,
|
|
4
|
+
ZERO_COLD_PULSE = 4,
|
|
5
|
+
SMART_VOLUME = 7,
|
|
6
|
+
TARGET_TEMPERATURE = 8
|
|
7
|
+
}
|
|
8
|
+
declare abstract class MessageE3Base extends MessageRequest {
|
|
9
|
+
constructor(device_protocol_version: number, message_type: MessageType, body_type: number);
|
|
10
|
+
}
|
|
11
|
+
export declare class MessageQuery extends MessageE3Base {
|
|
12
|
+
constructor(device_protocol_version: number);
|
|
13
|
+
get _body(): Buffer;
|
|
14
|
+
}
|
|
15
|
+
export declare class MessagePower extends MessageE3Base {
|
|
16
|
+
power: boolean;
|
|
17
|
+
constructor(device_protocol_version: number);
|
|
18
|
+
get _body(): Buffer;
|
|
19
|
+
}
|
|
20
|
+
export declare class MessageSet extends MessageE3Base {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
target_temperature: number;
|
|
23
|
+
zero_cold_water: boolean;
|
|
24
|
+
bathtub_volume: number;
|
|
25
|
+
protection: boolean;
|
|
26
|
+
zero_cold_pulse: boolean;
|
|
27
|
+
smart_volume: boolean;
|
|
28
|
+
constructor(device_protocol_version: number);
|
|
29
|
+
get _body(): Buffer;
|
|
30
|
+
}
|
|
31
|
+
export declare class MessageNewProtocolSet extends MessageE3Base {
|
|
32
|
+
key?: keyof typeof NewProtocolTags;
|
|
33
|
+
value?: number | boolean;
|
|
34
|
+
constructor(device_protocol_version: number);
|
|
35
|
+
get _body(): Buffer;
|
|
36
|
+
}
|
|
37
|
+
export declare class E3GeneralMessageBody extends MessageBody {
|
|
38
|
+
power: boolean;
|
|
39
|
+
burning_state: boolean;
|
|
40
|
+
zero_cold_water: boolean;
|
|
41
|
+
current_temperature: number;
|
|
42
|
+
target_temperature: number;
|
|
43
|
+
protection: boolean;
|
|
44
|
+
zero_cold_pulse: boolean;
|
|
45
|
+
smart_volume: boolean;
|
|
46
|
+
constructor(body: Buffer);
|
|
47
|
+
}
|
|
48
|
+
export declare class MessageE3Response extends MessageResponse {
|
|
49
|
+
constructor(message: Buffer);
|
|
50
|
+
}
|
|
51
|
+
export {};
|