homebridge-melcloud-control 4.4.1-beta.2 → 4.4.1-beta.21
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 +9 -0
- package/README.md +34 -34
- package/config.schema.json +54 -54
- package/index.js +32 -32
- package/package.json +2 -2
- package/src/constants.js +62 -50
- package/src/deviceata.js +2 -6
- package/src/deviceatw.js +2 -6
- package/src/deviceerv.js +2 -6
- package/src/functions.js +100 -108
- package/src/melcloud.js +4 -4
- package/src/melcloudata.js +9 -9
- package/src/melcloudatw.js +8 -8
- package/src/melclouderv.js +7 -7
- package/src/melcloudhome.js +33 -31
package/index.js
CHANGED
|
@@ -31,12 +31,12 @@ class MelCloudPlatform {
|
|
|
31
31
|
api.on('didFinishLaunching', async () => {
|
|
32
32
|
//loop through accounts
|
|
33
33
|
for (const account of config.accounts) {
|
|
34
|
-
const {
|
|
35
|
-
if (!
|
|
36
|
-
log.warn(`Account ${!
|
|
34
|
+
const { name, user, passwd, language, type } = account;
|
|
35
|
+
if (!name || accountsName.includes(name) || !user || !passwd || !language || !type) {
|
|
36
|
+
log.warn(`Account ${!name ? 'name missing' : (accountsName.includes(name) ? 'name duplicated' : name)} ${!user ? ', user missing' : ''}${!passwd ? ', password missing' : ''}${!language ? ', language missing' : ''}${!type ? ', type disabled' : ''} in config, will not be published in the Home app`);
|
|
37
37
|
continue;
|
|
38
38
|
}
|
|
39
|
-
accountsName.push(
|
|
39
|
+
accountsName.push(name);
|
|
40
40
|
const accountRefreshInterval = (account.refreshInterval ?? 120) * 1000
|
|
41
41
|
|
|
42
42
|
//log config
|
|
@@ -50,7 +50,7 @@ class MelCloudPlatform {
|
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
if (logLevel.debug) {
|
|
53
|
-
log.info(`${
|
|
53
|
+
log.info(`${name}, debug: did finish launching.`);
|
|
54
54
|
const safeConfig = {
|
|
55
55
|
...account,
|
|
56
56
|
passwd: 'removed',
|
|
@@ -61,12 +61,12 @@ class MelCloudPlatform {
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
};
|
|
64
|
-
log.info(`${
|
|
64
|
+
log.info(`${name}, Config: ${JSON.stringify(safeConfig, null, 2)}`);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
//define directory and file paths
|
|
68
|
-
const accountFile = `${prefDir}/${
|
|
69
|
-
const buildingsFile = `${prefDir}/${
|
|
68
|
+
const accountFile = `${prefDir}/${name}_Account`;
|
|
69
|
+
const buildingsFile = `${prefDir}/${name}_Buildings`;
|
|
70
70
|
|
|
71
71
|
try {
|
|
72
72
|
//create impulse generator
|
|
@@ -89,24 +89,24 @@ class MelCloudPlatform {
|
|
|
89
89
|
if (logLevel.warn) log.warn(`Unknown account type: ${account.type}.`);
|
|
90
90
|
return;
|
|
91
91
|
}
|
|
92
|
-
melcloud.on('success', (msg) => log.success(`${
|
|
93
|
-
.on('info', (msg) => log.info(`${
|
|
94
|
-
.on('debug', (msg) => log.info(`${
|
|
95
|
-
.on('warn', (msg) => log.warn(`${
|
|
96
|
-
.on('error', (msg) => log.error(`${
|
|
92
|
+
melcloud.on('success', (msg) => log.success(`${name}, ${msg}`))
|
|
93
|
+
.on('info', (msg) => log.info(`${name}, ${msg}`))
|
|
94
|
+
.on('debug', (msg) => log.info(`${name}, debug: ${msg}`))
|
|
95
|
+
.on('warn', (msg) => log.warn(`${name}, ${msg}`))
|
|
96
|
+
.on('error', (msg) => log.error(`${name}, ${msg}`));
|
|
97
97
|
|
|
98
98
|
//connect
|
|
99
99
|
const accountInfo = await melcloud.connect();
|
|
100
100
|
if (!accountInfo?.State) {
|
|
101
|
-
if (logLevel.warn) log.warn(`${
|
|
101
|
+
if (logLevel.warn) log.warn(`${name}, ${accountInfo?.Info}`);
|
|
102
102
|
return;
|
|
103
103
|
}
|
|
104
|
-
if (logLevel.success) log.success(`${
|
|
104
|
+
if (logLevel.success) log.success(`${name}, ${accountInfo.Info}`);
|
|
105
105
|
|
|
106
106
|
//check devices list
|
|
107
107
|
const melcloudDevicesList = await melcloud.checkDevicesList();
|
|
108
108
|
if (!melcloudDevicesList.State) {
|
|
109
|
-
if (logLevel.warn) log.warn(`${
|
|
109
|
+
if (logLevel.warn) log.warn(`${name}, ${melcloudDevicesList.Info}`);
|
|
110
110
|
return;
|
|
111
111
|
}
|
|
112
112
|
if (logLevel.debug) log.info(melcloudDevicesList.Info);
|
|
@@ -120,33 +120,33 @@ class MelCloudPlatform {
|
|
|
120
120
|
const atwDevices = (account.atwDevices || []).filter(device => device.id != null && String(device.id) !== '0');
|
|
121
121
|
const ervDevices = (account.ervDevices || []).filter(device => device.id != null && String(device.id) !== '0');
|
|
122
122
|
const devices = [...ataDevices, ...atwDevices, ...ervDevices];
|
|
123
|
-
if (logLevel.debug) log.info(`${
|
|
123
|
+
if (logLevel.debug) log.info(`${name}, found configured devices ATA: ${ataDevices.length}, ATW: ${atwDevices.length}, ERV: ${ervDevices.length}.`);
|
|
124
124
|
|
|
125
125
|
for (const [index, device] of devices.entries()) {
|
|
126
126
|
device.id = String(device.id);
|
|
127
127
|
const deviceName = device.name;
|
|
128
128
|
const deviceType = device.type;
|
|
129
129
|
const deviceTypeString = device.typeString;
|
|
130
|
-
const defaultTempsFile = `${prefDir}/${
|
|
130
|
+
const defaultTempsFile = `${prefDir}/${name}_${device.id}_Temps`;
|
|
131
131
|
|
|
132
132
|
//chack device is not disabled in config
|
|
133
133
|
const displayType = device.displayType;
|
|
134
134
|
if (!displayType) {
|
|
135
|
-
if (logLevel.warn) log.warn(`${
|
|
135
|
+
if (logLevel.warn) log.warn(`${name}, ${deviceTypeString}, ${deviceName}, disabled in configuration, will not be published in the Home app.`);
|
|
136
136
|
continue;
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
//chack device from config exist on melcloud
|
|
140
140
|
const deviceExistInMelCloud = melcloudDevicesList.Devices.some(dev => dev.DeviceID === device.id);
|
|
141
141
|
if (!deviceExistInMelCloud) {
|
|
142
|
-
if (logLevel.warn) log.warn(`${
|
|
142
|
+
if (logLevel.warn) log.warn(`${name}, ${deviceTypeString}, ${deviceName}, not exist on server, please login to MELCLoud from plugin UI to fix this issue.`);
|
|
143
143
|
continue;
|
|
144
144
|
}
|
|
145
145
|
|
|
146
146
|
// set rest ful port
|
|
147
147
|
account.restFul.port = (device.id).slice(-4).replace(/^0/, '9');
|
|
148
148
|
|
|
149
|
-
if (
|
|
149
|
+
if (type === 'melcloudhome') {
|
|
150
150
|
account.restFul.port = `${3000}${index}`;
|
|
151
151
|
|
|
152
152
|
try {
|
|
@@ -160,7 +160,7 @@ class MelCloudPlatform {
|
|
|
160
160
|
if (logLevel.debug) log.debug(`Default temperature file created: ${defaultTempsFile}`);
|
|
161
161
|
}
|
|
162
162
|
} catch (error) {
|
|
163
|
-
if (logLevel.error) log.error(`${
|
|
163
|
+
if (logLevel.error) log.error(`${name}, ${deviceTypeString}, ${deviceName}, File init error: ${error.message}`);
|
|
164
164
|
continue;
|
|
165
165
|
}
|
|
166
166
|
}
|
|
@@ -179,37 +179,37 @@ class MelCloudPlatform {
|
|
|
179
179
|
configuredDevice = new DeviceErv(api, account, device, defaultTempsFile, accountInfo, accountFile, melcloud, melcloudDevicesList);
|
|
180
180
|
break;
|
|
181
181
|
default:
|
|
182
|
-
if (logLevel.warn) log.warn(`${
|
|
182
|
+
if (logLevel.warn) log.warn(`${name}, ${deviceTypeString}, ${deviceName}, unknown device: ${deviceType}.`);
|
|
183
183
|
return;
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
configuredDevice.on('devInfo', (info) => logLevel.devInfo && log.info(info))
|
|
187
|
-
.on('success', (msg) => log.success(`${
|
|
188
|
-
.on('info', (msg) => log.info(`${
|
|
189
|
-
.on('debug', (msg) => log.info(`${
|
|
190
|
-
.on('warn', (msg) => log.warn(`${
|
|
191
|
-
.on('error', (msg) => log.error(`${
|
|
187
|
+
.on('success', (msg) => log.success(`${name}, ${deviceTypeString}, ${deviceName}, ${msg}`))
|
|
188
|
+
.on('info', (msg) => log.info(`${name}, ${deviceTypeString}, ${deviceName}, ${msg}`))
|
|
189
|
+
.on('debug', (msg) => log.info(`${name}, ${deviceTypeString}, ${deviceName}, debug: ${msg}`))
|
|
190
|
+
.on('warn', (msg) => log.warn(`${name}, ${deviceTypeString}, ${deviceName}, ${msg}`))
|
|
191
|
+
.on('error', (msg) => log.error(`${name}, ${deviceTypeString}, ${deviceName}, ${msg}`));
|
|
192
192
|
|
|
193
193
|
const accessory = await configuredDevice.start();
|
|
194
194
|
if (accessory) {
|
|
195
195
|
api.publishExternalAccessories(PluginName, [accessory]);
|
|
196
|
-
if (logLevel.success) log.success(`${
|
|
196
|
+
if (logLevel.success) log.success(`${name}, ${deviceTypeString}, ${deviceName}, Published as external accessory.`);
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
//stop start impulse generator
|
|
201
201
|
await impulseGenerator.state(false);
|
|
202
202
|
} catch (error) {
|
|
203
|
-
if (logLevel.error) log.error(`${
|
|
203
|
+
if (logLevel.error) log.error(`${name}, Start impulse generator error, ${error.message ?? error}, trying again.`);
|
|
204
204
|
}
|
|
205
205
|
}).on('state', (state) => {
|
|
206
|
-
if (logLevel.debug) log.info(`${
|
|
206
|
+
if (logLevel.debug) log.info(`${name}, Start impulse generator ${state ? 'started' : 'stopped'}.`);
|
|
207
207
|
});
|
|
208
208
|
|
|
209
209
|
//start impulse generator
|
|
210
210
|
await impulseGenerator.state(true, [{ name: 'start', sampling: 120000 }]);
|
|
211
211
|
} catch (error) {
|
|
212
|
-
if (logLevel.error) log.error(`${
|
|
212
|
+
if (logLevel.error) log.error(`${name}, Did finish launching error: ${error.message ?? error}.`);
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
215
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "4.4.1-beta.
|
|
4
|
+
"version": "4.4.1-beta.21",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"mqtt": "^5.14.1",
|
|
40
40
|
"axios": "^1.13.2",
|
|
41
41
|
"express": "^5.2.1",
|
|
42
|
-
"puppeteer": "^24.
|
|
42
|
+
"puppeteer": "^24.33.0",
|
|
43
43
|
"ws": "^8.18.3"
|
|
44
44
|
},
|
|
45
45
|
"keywords": [
|
package/src/constants.js
CHANGED
|
@@ -2,60 +2,67 @@ export const PlatformName = "melcloudcontrol";
|
|
|
2
2
|
export const PluginName = "homebridge-melcloud-control";
|
|
3
3
|
|
|
4
4
|
export const ApiUrls = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
SetAtw: "/Device/SetAtw",
|
|
14
|
-
SetErv: "/Device/SetErv",
|
|
15
|
-
GetRefreshUnit: "/Device/RequestRefresh?id=deviceid",
|
|
16
|
-
UpdateApplicationOptions: "/User/UpdateApplicationOptions",
|
|
17
|
-
HolidayModeUpdate: "/HolidayMode/Update",
|
|
18
|
-
EnergyCostReport: "/EnergyCost/Report",
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const ApiUrlsHome = {
|
|
22
|
-
BaseURL: "https://melcloudhome.com",
|
|
23
|
-
GetConfiguration: "https://melcloudhome.com/api/configuration",
|
|
24
|
-
GetUserContext: "/api/user/context",
|
|
25
|
-
GetUserScenes: "/api/user/scenes",
|
|
26
|
-
PostSchedule: "/api/cloudschedule/deviceid", // POST {"days":[2],"time":"17:59:00","enabled":true,"id":"53c5e804-0663-47d0-85c2-2d8ccd2573de","power":false,"operationMode":null,"setPoint":null,"vaneVerticalDirection":null,"vaneHorizontalDirection":null,"setFanSpeed":null}
|
|
27
|
-
PostProtectionFrost: "/api/protection/frost", // POST {"enabled":true,"min":13,"max":16,"units":{"ATA":["ef333525-2699-4290-af5a-2922566676da"]}}
|
|
28
|
-
PostProtectionOverheat: "/api/protection/overheat", // POST {"enabled":true,"min":32,"max":35,"units":{"ATA":["ef333525-2699-4290-af5a-2922566676da"]}}
|
|
29
|
-
PostHolidayMode: " /api/holidaymode", // POST {"enabled":true,"startDate":"2025-11-11T17:42:24.913","endDate":"2026-06-01T09:18:00","units":{"ATA":["ef333525-2699-4290-af5a-2922566676da"]}}
|
|
30
|
-
PutAta: "/api/ataunit/deviceid",
|
|
31
|
-
PutAtw: "/api/atwunit/deviceid",
|
|
32
|
-
PutErv: "/api/ervunit/deviceid",
|
|
33
|
-
PutScheduleEnabled: "/api/cloudschedule/deviceid/enabled", // PUT {"enabled":true}
|
|
34
|
-
PutScene: {
|
|
35
|
-
Enable: "/api/scene/sceneid/enable",
|
|
36
|
-
Disable: "/api/scene/sceneid/disable",
|
|
5
|
+
Base: "https://app.melcloud.com/Mitsubishi.Wifi.Client",
|
|
6
|
+
Get: {
|
|
7
|
+
UserDetails: "/User/GetUserDetails",
|
|
8
|
+
ListDevices: "/User/ListDevices",
|
|
9
|
+
ListDeviceUnits: "/Device/ListDeviceUnits",
|
|
10
|
+
RefreshUnit: "/Device/RequestRefresh?id=deviceid",
|
|
11
|
+
DeviceState: "/Device/Get?id=DID&buildingID=BID",
|
|
12
|
+
TileState: "/Tile/Get2?id=DID&buildingID=BID",
|
|
37
13
|
},
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
14
|
+
Post: {
|
|
15
|
+
ClientLogin: "/Login/ClientLogin",
|
|
16
|
+
Ata: "/Device/SetAta",
|
|
17
|
+
Atw: "/Device/SetAtw",
|
|
18
|
+
Erv: "/Device/SetErv",
|
|
19
|
+
UpdateApplicationOptions: "/User/UpdateApplicationOptions",
|
|
20
|
+
HolidayMode: "/HolidayMode/Update",
|
|
21
|
+
EnergyCostReport: "/EnergyCost/Report",
|
|
46
22
|
},
|
|
47
|
-
|
|
48
|
-
|
|
23
|
+
Home: {
|
|
24
|
+
Base: "https://melcloudhome.com",
|
|
25
|
+
WebSocket: "wss://ws.melcloudhome.com/?hash=",
|
|
26
|
+
Get: {
|
|
27
|
+
Configuration: "/api/configuration",
|
|
28
|
+
ListDevices: "/api/user/context",
|
|
29
|
+
Scenes: "/api/user/scenes",
|
|
30
|
+
},
|
|
31
|
+
Post: {
|
|
32
|
+
ProtectionFrost: "/api/protection/frost", //{"enabled":true,"min":13,"max":16,"units":{"ATA":["deviceid"]}}
|
|
33
|
+
ProtectionOverheat: "/api/protection/overheat", //{"enabled":true,"min":32,"max":35,"units":{"ATA":["deviceid"]}}
|
|
34
|
+
HolidayMode: "/api/holidaymode", //{"enabled":true,"startDate":"2025-11-11T17:42:24.913","endDate":"2026-06-01T09:18:00","units":{"ATA":["deviceid"]}}
|
|
35
|
+
Schedule: "/api/cloudschedule/deviceid", //{"days":[2],"time":"17:59:00","enabled":true,"id":"scheduleid","power":false,"operationMode":null,"setPoint":null,"vaneVerticalDirection":null,"vaneHorizontalDirection":null,"setFanSpeed":null}
|
|
36
|
+
Scene: "/api/scene", //{"id": "sceneid", "userId": "userid","name": "Poza domem","enabled": false,"icon": "AwayIcon","ataSceneSettings": [{"unitId": "deviceid","ataSettings": { "power": false, "operationMode": "heat","setFanSpeed": "auto","vaneHorizontalDirection": "auto", "vaneVerticalDirection": "auto", "setTemperature": 21,"temperatureIncrementOverride": null,"inStandbyMode": null},"previousSettings": null}],"atwSceneSettings": []}
|
|
37
|
+
},
|
|
38
|
+
Put: {
|
|
39
|
+
Ata: "/api/ataunit/deviceid", //{ power: true,setTemperature: 22, setFanSpeed: "auto", operationMode: "heat", vaneHorizontalDirection: "auto",vaneVerticalDirection: "auto", temperatureIncrementOverride: null, inStandbyMode: null}
|
|
40
|
+
Atw: "/api/atwunit/deviceid",
|
|
41
|
+
Erv: "/api/ervunit/deviceid",
|
|
42
|
+
ScheduleEnableDisable: "/api/cloudschedule/deviceid/enabled", // {"enabled": true}
|
|
43
|
+
SceneEnableDisable: "/api/scene/sceneid/enabledisable",
|
|
44
|
+
},
|
|
45
|
+
Delete: {
|
|
46
|
+
Schedule: "/api/cloudschedule/deviceid/scheduleid",
|
|
47
|
+
Scene: "/api/scene/sceneid"
|
|
48
|
+
},
|
|
49
|
+
Referers: {
|
|
50
|
+
GetPutScenes: "https://melcloudhome.com/scenes",
|
|
51
|
+
PostHolidayMode: "https://melcloudhome.com/ata/deviceid/holidaymode",
|
|
52
|
+
PostProtectionFrost: "https://melcloudhome.com/ata/deviceid/frostprotection",
|
|
53
|
+
PostProtectionOverheat: "https://melcloudhome.com/ata/deviceid/overheatprotection",
|
|
54
|
+
PutDeviceSettings: "https://melcloudhome.com/dashboard",
|
|
55
|
+
PutScheduleEnabled: "https://melcloudhome.com/ata/deviceid/schedule",
|
|
56
|
+
}
|
|
57
|
+
}
|
|
49
58
|
};
|
|
50
59
|
|
|
51
|
-
export const DeviceType =
|
|
52
|
-
"Air Conditioner",
|
|
53
|
-
"Heat Pump",
|
|
54
|
-
"Unknown",
|
|
55
|
-
"Energy Recovery Ventilation"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
export const TemperatureDisplayUnits = ["°C", "°F"];
|
|
60
|
+
export const DeviceType = {
|
|
61
|
+
0: "Air Conditioner",
|
|
62
|
+
1: "Heat Pump",
|
|
63
|
+
2: "Unknown",
|
|
64
|
+
3: "Energy Recovery Ventilation"
|
|
65
|
+
};
|
|
59
66
|
|
|
60
67
|
export const AirConditioner = {
|
|
61
68
|
SystemMapEnumToString: { 0: "Air Conditioner Off", 1: "Air Conditioner On", 2: "Air Conditioner Offline" },
|
|
@@ -183,6 +190,11 @@ export const Ventilation = {
|
|
|
183
190
|
}
|
|
184
191
|
};
|
|
185
192
|
|
|
193
|
+
export const TemperatureDisplayUnits = {
|
|
194
|
+
0: "°C",
|
|
195
|
+
1: "°F"
|
|
196
|
+
};
|
|
197
|
+
|
|
186
198
|
export const AccessLevel = {
|
|
187
199
|
Quest: 3,
|
|
188
200
|
Owner: 4
|
package/src/deviceata.js
CHANGED
|
@@ -65,7 +65,6 @@ class DeviceAta extends EventEmitter {
|
|
|
65
65
|
|
|
66
66
|
//presets configured
|
|
67
67
|
for (const preset of this.presets) {
|
|
68
|
-
preset.name = preset.name;
|
|
69
68
|
preset.serviceType = serviceType[preset.displayType];
|
|
70
69
|
preset.characteristicType = characteristicType[preset.displayType];
|
|
71
70
|
preset.state = false;
|
|
@@ -74,7 +73,6 @@ class DeviceAta extends EventEmitter {
|
|
|
74
73
|
|
|
75
74
|
//schedules configured
|
|
76
75
|
for (const schedule of this.schedules) {
|
|
77
|
-
schedule.name = schedule.name;
|
|
78
76
|
schedule.serviceType = serviceType[schedule.displayType];
|
|
79
77
|
schedule.characteristicType = characteristicType[schedule.displayType];
|
|
80
78
|
schedule.state = false;
|
|
@@ -82,7 +80,6 @@ class DeviceAta extends EventEmitter {
|
|
|
82
80
|
|
|
83
81
|
//scenes configured
|
|
84
82
|
for (const scene of this.scenes) {
|
|
85
|
-
scene.name = scene.name;
|
|
86
83
|
scene.serviceType = serviceType[scene.displayType];
|
|
87
84
|
scene.characteristicType = characteristicType[scene.displayType];
|
|
88
85
|
scene.state = false;
|
|
@@ -90,7 +87,6 @@ class DeviceAta extends EventEmitter {
|
|
|
90
87
|
|
|
91
88
|
//buttons configured
|
|
92
89
|
for (const button of this.buttons) {
|
|
93
|
-
button.name = button.name;
|
|
94
90
|
button.serviceType = serviceType[button.displayType];
|
|
95
91
|
button.characteristicType = characteristicType[button.displayType];
|
|
96
92
|
button.state = false;
|
|
@@ -522,8 +518,8 @@ class DeviceAta extends EventEmitter {
|
|
|
522
518
|
|
|
523
519
|
try {
|
|
524
520
|
this.accessory.useFahrenheit = value ? true : false;
|
|
525
|
-
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
526
521
|
this.accountInfo.UseFahrenheit = value ? true : false;
|
|
522
|
+
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
527
523
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'account', this.accountInfo);
|
|
528
524
|
} catch (error) {
|
|
529
525
|
if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
@@ -615,8 +611,8 @@ class DeviceAta extends EventEmitter {
|
|
|
615
611
|
|
|
616
612
|
try {
|
|
617
613
|
this.accessory.useFahrenheit = value ? true : false;
|
|
618
|
-
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
619
614
|
this.accountInfo.UseFahrenheit = value ? true : false;
|
|
615
|
+
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
620
616
|
await this.melCloudAta.send(this.accountType, this.displayType, deviceData, 'account', this.accountInfo);
|
|
621
617
|
} catch (error) {
|
|
622
618
|
if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
|
package/src/deviceatw.js
CHANGED
|
@@ -69,7 +69,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
69
69
|
|
|
70
70
|
//presets configured
|
|
71
71
|
for (const preset of this.presets) {
|
|
72
|
-
preset.name = preset.name;
|
|
73
72
|
preset.serviceType = serviceType[preset.displayType];
|
|
74
73
|
preset.characteristicType = characteristicType[preset.displayType];
|
|
75
74
|
preset.state = false;
|
|
@@ -78,7 +77,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
78
77
|
|
|
79
78
|
//schedules configured
|
|
80
79
|
for (const schedule of this.schedules) {
|
|
81
|
-
schedule.name = schedule.name;
|
|
82
80
|
schedule.serviceType = serviceType[schedule.displayType];
|
|
83
81
|
schedule.characteristicType = characteristicType[schedule.displayType];
|
|
84
82
|
schedule.state = false;
|
|
@@ -86,7 +84,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
86
84
|
|
|
87
85
|
//scenes configured
|
|
88
86
|
for (const scene of this.scenes) {
|
|
89
|
-
scene.name = scene.name;
|
|
90
87
|
scene.serviceType = serviceType[scene.displayType];
|
|
91
88
|
scene.characteristicType = characteristicType[scene.displayType];
|
|
92
89
|
scene.state = false;
|
|
@@ -94,7 +91,6 @@ class DeviceAtw extends EventEmitter {
|
|
|
94
91
|
|
|
95
92
|
//buttons configured
|
|
96
93
|
for (const button of this.buttons) {
|
|
97
|
-
button.name = button.name;
|
|
98
94
|
button.serviceType = serviceType[button.displayType];
|
|
99
95
|
button.characteristicType = characteristicType[button.displayType];
|
|
100
96
|
button.state = false;
|
|
@@ -645,8 +641,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
645
641
|
|
|
646
642
|
try {
|
|
647
643
|
this.accessory.useFahrenheit = value ? true : false;
|
|
648
|
-
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
649
644
|
this.accountInfo.UseFahrenheit = value ? true : false;
|
|
645
|
+
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
650
646
|
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, 'account', this.accountInfo);
|
|
651
647
|
} catch (error) {
|
|
652
648
|
if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
@@ -826,8 +822,8 @@ class DeviceAtw extends EventEmitter {
|
|
|
826
822
|
|
|
827
823
|
try {
|
|
828
824
|
this.accessory.useFahrenheit = value ? true : false;
|
|
829
|
-
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
830
825
|
this.accountInfo.UseFahrenheit = value ? true : false;
|
|
826
|
+
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
831
827
|
await this.melCloudAtw.send(this.accountType, this.displayType, deviceData, 'account', this.accountInfo);
|
|
832
828
|
} catch (error) {
|
|
833
829
|
if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
|
package/src/deviceerv.js
CHANGED
|
@@ -61,7 +61,6 @@ class DeviceErv extends EventEmitter {
|
|
|
61
61
|
|
|
62
62
|
//presets configured
|
|
63
63
|
for (const preset of this.presets) {
|
|
64
|
-
preset.name = preset.name;
|
|
65
64
|
preset.serviceType = serviceType[preset.displayType];
|
|
66
65
|
preset.characteristicType = characteristicType[preset.displayType];
|
|
67
66
|
preset.state = false;
|
|
@@ -70,7 +69,6 @@ class DeviceErv extends EventEmitter {
|
|
|
70
69
|
|
|
71
70
|
//schedules configured
|
|
72
71
|
for (const schedule of this.schedules) {
|
|
73
|
-
schedule.name = schedule.name;
|
|
74
72
|
schedule.serviceType = serviceType[schedule.displayType];
|
|
75
73
|
schedule.characteristicType = characteristicType[schedule.displayType];
|
|
76
74
|
schedule.state = false;
|
|
@@ -78,7 +76,6 @@ class DeviceErv extends EventEmitter {
|
|
|
78
76
|
|
|
79
77
|
//scenes configured
|
|
80
78
|
for (const scene of this.scenes) {
|
|
81
|
-
scene.name = scene.name;
|
|
82
79
|
scene.serviceType = serviceType[scene.displayType];
|
|
83
80
|
scene.characteristicType = characteristicType[scene.displayType];
|
|
84
81
|
scene.state = false;
|
|
@@ -86,7 +83,6 @@ class DeviceErv extends EventEmitter {
|
|
|
86
83
|
|
|
87
84
|
//buttons configured
|
|
88
85
|
for (const button of this.buttons) {
|
|
89
|
-
button.name = button.name;
|
|
90
86
|
button.serviceType = serviceType[button.displayType];
|
|
91
87
|
button.characteristicType = characteristicType[button.displayType];
|
|
92
88
|
button.state = false;
|
|
@@ -454,8 +450,8 @@ class DeviceErv extends EventEmitter {
|
|
|
454
450
|
|
|
455
451
|
try {
|
|
456
452
|
this.accessory.useFahrenheit = value ? true : false;
|
|
457
|
-
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
458
453
|
this.accountInfo.UseFahrenheit = value ? true : false;
|
|
454
|
+
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
459
455
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, 'account', this.accountInfo);
|
|
460
456
|
} catch (error) {
|
|
461
457
|
if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
|
|
@@ -548,8 +544,8 @@ class DeviceErv extends EventEmitter {
|
|
|
548
544
|
|
|
549
545
|
try {
|
|
550
546
|
this.accessory.useFahrenheit = value ? true : false;
|
|
551
|
-
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
552
547
|
this.accountInfo.UseFahrenheit = value ? true : false;
|
|
548
|
+
if (this.logInfo) this.emit('info', `Set temperature display unit: ${TemperatureDisplayUnits[value]}`);
|
|
553
549
|
await this.melCloudErv.send(this.accountType, this.displayType, deviceData, 'account', this.accountInfo);
|
|
554
550
|
} catch (error) {
|
|
555
551
|
if (this.logWarn) this.emit('warn', `Set temperature display unit error: ${error}`);
|