homebridge-melcloud-control 3.3.31 → 3.3.32-beta.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 +6 -0
- package/homebridge-ui/server.js +2 -2
- package/index.js +16 -15
- package/package.json +1 -1
- package/src/deviceata.js +81 -80
- package/src/deviceatw.js +113 -112
- package/src/deviceerv.js +54 -53
- package/src/impulsegenerator.js +2 -2
- package/src/melcloud.js +21 -20
- package/src/melcloudata.js +13 -12
- package/src/melcloudatw.js +13 -12
- package/src/melclouderv.js +13 -12
- package/src/mqtt.js +4 -4
- package/src/restful.js +4 -4
package/src/mqtt.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { connectAsync } from "async-mqtt";
|
|
3
|
+
import EventEmitter from 'events';
|
|
4
4
|
|
|
5
5
|
class Mqtt extends EventEmitter {
|
|
6
6
|
constructor(config) {
|
|
@@ -16,7 +16,7 @@ class Mqtt extends EventEmitter {
|
|
|
16
16
|
this.on('connect', async () => {
|
|
17
17
|
try {
|
|
18
18
|
//connect
|
|
19
|
-
this.mqttClient = await
|
|
19
|
+
this.mqttClient = await connectAsync(url, options);
|
|
20
20
|
this.emit('connected', 'MQTT Connected.');
|
|
21
21
|
|
|
22
22
|
//subscribe
|
|
@@ -52,4 +52,4 @@ class Mqtt extends EventEmitter {
|
|
|
52
52
|
this.emit('connect');
|
|
53
53
|
};
|
|
54
54
|
};
|
|
55
|
-
|
|
55
|
+
export default Mqtt;
|
package/src/restful.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import express, { json } from 'express';
|
|
3
|
+
import EventEmitter from 'events';
|
|
4
4
|
|
|
5
5
|
class RestFul extends EventEmitter {
|
|
6
6
|
constructor(config) {
|
|
@@ -20,7 +20,7 @@ class RestFul extends EventEmitter {
|
|
|
20
20
|
try {
|
|
21
21
|
const restFul = express();
|
|
22
22
|
restFul.set('json spaces', 2);
|
|
23
|
-
restFul.use(
|
|
23
|
+
restFul.use(json());
|
|
24
24
|
restFul.get('/info', (req, res) => { res.json(this.restFulData.info) });
|
|
25
25
|
restFul.get('/state', (req, res) => { res.json(this.restFulData.state) });
|
|
26
26
|
|
|
@@ -62,4 +62,4 @@ class RestFul extends EventEmitter {
|
|
|
62
62
|
const emitDebug = this.restFulDebug ? this.emit('debug', `RESTFul update path: ${path}, data: ${data}`) : false;
|
|
63
63
|
};
|
|
64
64
|
};
|
|
65
|
-
|
|
65
|
+
export default RestFul;
|