homebridge-melcloud-control 3.3.30 → 3.3.32-beta.0
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 +6 -0
- package/homebridge-ui/server.js +2 -2
- package/index.js +15 -15
- package/package.json +3 -3
- package/src/deviceata.js +80 -80
- package/src/deviceatw.js +112 -112
- package/src/deviceerv.js +53 -53
- package/src/impulsegenerator.js +2 -2
- package/src/melcloud.js +20 -20
- package/src/melcloudata.js +12 -12
- package/src/melcloudatw.js +12 -12
- package/src/melclouderv.js +12 -12
- package/src/mqtt.js +4 -4
- package/src/restful.js +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -16,6 +16,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
16
16
|
- do not configure it manually, always using Config UI X
|
|
17
17
|
- required Homebridge v2.0.0 and above
|
|
18
18
|
|
|
19
|
+
## [3.3.21] - (29.11.2024)
|
|
20
|
+
|
|
21
|
+
## Changes
|
|
22
|
+
|
|
23
|
+
- move from commonJS to esm module, fixing [#180](https://github.com/grzegorz914/homebridge-melcloud-control/issues/180)
|
|
24
|
+
|
|
19
25
|
## [3.3.20] - (25.09.2024)
|
|
20
26
|
|
|
21
27
|
## Changes
|
package/homebridge-ui/server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { HomebridgePluginUiServer, RequestError } from '@homebridge/plugin-ui-utils';
|
|
4
|
+
import MelCloud from '../src/melcloud.js';
|
|
5
5
|
|
|
6
6
|
class PluginUiServer extends HomebridgePluginUiServer {
|
|
7
7
|
constructor() {
|
package/index.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
'use strict';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
import { join } from 'path';
|
|
3
|
+
import { mkdirSync } from 'fs';
|
|
4
|
+
import MelCloud from './src/melcloud.js';
|
|
5
|
+
import DeviceAta from './src/deviceata.js';
|
|
6
|
+
import DeviceAtw from './src/deviceatw.js';
|
|
7
|
+
import DeviceErv from './src/deviceerv.js';
|
|
8
|
+
import { PluginName, PlatformName } from './src/constants.json';
|
|
9
9
|
|
|
10
10
|
class MelCloudPlatform {
|
|
11
11
|
constructor(log, config, api) {
|
|
12
12
|
// only load if configured
|
|
13
13
|
if (!config || !Array.isArray(config.accounts)) {
|
|
14
|
-
log.warn(`No configuration found for ${
|
|
14
|
+
log.warn(`No configuration found for ${PluginName}`);
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
this.accessories = [];
|
|
18
18
|
const accountsName = [];
|
|
19
19
|
|
|
20
20
|
//create directory if it doesn't exist
|
|
21
|
-
const prefDir =
|
|
21
|
+
const prefDir = join(api.user.storagePath(), 'melcloud');
|
|
22
22
|
try {
|
|
23
23
|
//create directory if it doesn't exist
|
|
24
|
-
|
|
24
|
+
mkdirSync(prefDir, { recursive: true });
|
|
25
25
|
} catch (error) {
|
|
26
26
|
log.error(`Prepare directory error: ${error}`);
|
|
27
27
|
return;
|
|
@@ -121,7 +121,7 @@ class MelCloudPlatform {
|
|
|
121
121
|
airConditioner.on('publishAccessory', (accessory) => {
|
|
122
122
|
|
|
123
123
|
//publish device
|
|
124
|
-
api.publishExternalAccessories(
|
|
124
|
+
api.publishExternalAccessories(PluginName, [accessory]);
|
|
125
125
|
log.success(`${accountName}, ${deviceTypeText} ${deviceName}, published as external accessory.`);
|
|
126
126
|
})
|
|
127
127
|
.on('devInfo', (devInfo) => {
|
|
@@ -166,7 +166,7 @@ class MelCloudPlatform {
|
|
|
166
166
|
heatPump.on('publishAccessory', (accessory) => {
|
|
167
167
|
|
|
168
168
|
//publish device
|
|
169
|
-
api.publishExternalAccessories(
|
|
169
|
+
api.publishExternalAccessories(PluginName, [accessory]);
|
|
170
170
|
log.success(`${accountName}, ${deviceTypeText} ${deviceName}, published as external accessory.`);
|
|
171
171
|
})
|
|
172
172
|
.on('devInfo', (devInfo) => {
|
|
@@ -211,7 +211,7 @@ class MelCloudPlatform {
|
|
|
211
211
|
energyRecoveryVentilation.on('publishAccessory', (accessory) => {
|
|
212
212
|
|
|
213
213
|
//publish device
|
|
214
|
-
api.publishExternalAccessories(
|
|
214
|
+
api.publishExternalAccessories(PluginName, [accessory]);
|
|
215
215
|
log.success(`${accountName}, ${deviceTypeText} ${deviceName}, published as external accessory.`);
|
|
216
216
|
})
|
|
217
217
|
.on('devInfo', (devInfo) => {
|
|
@@ -250,6 +250,6 @@ class MelCloudPlatform {
|
|
|
250
250
|
};
|
|
251
251
|
};
|
|
252
252
|
|
|
253
|
-
|
|
254
|
-
api.registerPlatform(
|
|
253
|
+
export default (api) => {
|
|
254
|
+
api.registerPlatform(PluginName, PlatformName, MelCloudPlatform, true);
|
|
255
255
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "MELCloud Control",
|
|
3
3
|
"name": "homebridge-melcloud-control",
|
|
4
|
-
"version": "3.3.
|
|
4
|
+
"version": "3.3.32-beta.0",
|
|
5
5
|
"description": "Homebridge plugin to control Mitsubishi Air Conditioner, Heat Pump and Energy Recovery Ventilation.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "grzegorz914",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
"node": "^18.20.4 || ^20.15.1 || ^22.7.0 || ^23.2.0"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@homebridge/plugin-ui-utils": "^
|
|
35
|
+
"@homebridge/plugin-ui-utils": "^2.0.0",
|
|
36
36
|
"async-mqtt": "^2.6.3",
|
|
37
|
-
"axios": "^1.7.
|
|
37
|
+
"axios": "^1.7.8",
|
|
38
38
|
"express": "^4.21.1"
|
|
39
39
|
},
|
|
40
40
|
"keywords": [
|