iobroker.panasonic-comfort-cloud 1.2.9 → 2.0.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/README.md +10 -0
- package/build/lib/tools.js +2 -1
- package/build/main.js +114 -72
- package/io-package.json +51 -5
- package/package.json +6 -8
- package/.github/ISSUE_TEMPLATE/bug_report.md +0 -32
- package/.github/workflows/test-and-release.yml +0 -59
package/README.md
CHANGED
|
@@ -21,6 +21,16 @@ It is recommended that a second account, for which the devices have been shared,
|
|
|
21
21
|
|
|
22
22
|
## Changelog
|
|
23
23
|
|
|
24
|
+
### 2.0.0
|
|
25
|
+
* Added js-controller 3 dependency.
|
|
26
|
+
* Added username and password to protectedNative and password to encryptedNative.
|
|
27
|
+
* Added connection info.
|
|
28
|
+
* Changed schdule to timeout for refresh.
|
|
29
|
+
* Fixes for async await pattern.
|
|
30
|
+
|
|
31
|
+
### 1.2.9
|
|
32
|
+
* Error handling for get device added.
|
|
33
|
+
|
|
24
34
|
### 1.2.8
|
|
25
35
|
* Fixed bug in Comfort Cloud client.
|
|
26
36
|
|
package/build/lib/tools.js
CHANGED
|
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.translateText = exports.isArray = exports.isObject = void 0;
|
|
12
13
|
const axios_1 = require("axios");
|
|
13
14
|
/**
|
|
14
15
|
* Tests whether the given variable is a real object and not an Array
|
|
@@ -43,7 +44,7 @@ function translateText(text, targetLang) {
|
|
|
43
44
|
return text;
|
|
44
45
|
try {
|
|
45
46
|
const url = `http://translate.googleapis.com/translate_a/single?client=gtx&sl=en&tl=${targetLang}&dt=t&q=${encodeURIComponent(text)}&ie=UTF-8&oe=UTF-8`;
|
|
46
|
-
const response = yield axios_1.default({ url, timeout: 5000 });
|
|
47
|
+
const response = yield (0, axios_1.default)({ url, timeout: 5000 });
|
|
47
48
|
if (isArray(response.data)) {
|
|
48
49
|
// we got a valid response
|
|
49
50
|
return response.data[0][0][0];
|
package/build/main.js
CHANGED
|
@@ -16,12 +16,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
16
16
|
// you need to create an adapter
|
|
17
17
|
const utils = require("@iobroker/adapter-core");
|
|
18
18
|
const panasonic_comfort_cloud_client_1 = require("panasonic-comfort-cloud-client");
|
|
19
|
-
const node_schedule_1 = require("node-schedule");
|
|
20
19
|
const _ = require("lodash");
|
|
20
|
+
const REFRESH_INTERVAL_IN_MINUTES_DEFAULT = 5;
|
|
21
21
|
const comfortCloudClient = new panasonic_comfort_cloud_client_1.ComfortCloudClient();
|
|
22
22
|
class PanasonicComfortCloud extends utils.Adapter {
|
|
23
23
|
constructor(options = {}) {
|
|
24
24
|
super(Object.assign(Object.assign({}, options), { name: 'panasonic-comfort-cloud' }));
|
|
25
|
+
this.refreshIntervalInMinutes = REFRESH_INTERVAL_IN_MINUTES_DEFAULT;
|
|
26
|
+
this.readonlyStateNames = [];
|
|
25
27
|
this.on('ready', this.onReady.bind(this));
|
|
26
28
|
this.on('objectChange', this.onObjectChange.bind(this));
|
|
27
29
|
this.on('stateChange', this.onStateChange.bind(this));
|
|
@@ -32,51 +34,59 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
32
34
|
* Is called when databases are connected and adapter received configuration.
|
|
33
35
|
*/
|
|
34
36
|
onReady() {
|
|
35
|
-
var _a;
|
|
37
|
+
var _a, _b, _c, _d;
|
|
36
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
-
|
|
38
|
-
this.refreshJob = node_schedule_1.scheduleJob(`*/${refreshInterval} * * * *`, this.refreshDevices.bind(this));
|
|
39
|
+
this.refreshIntervalInMinutes = (_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.refreshInterval) !== null && _b !== void 0 ? _b : REFRESH_INTERVAL_IN_MINUTES_DEFAULT;
|
|
39
40
|
this.subscribeStates('*');
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
this.log.info('Login successful.');
|
|
44
|
-
this.log.debug('Create devices.');
|
|
45
|
-
const groups = yield comfortCloudClient.getGroups();
|
|
46
|
-
this.createDevices(groups);
|
|
41
|
+
this.setState('info.connection', false, true);
|
|
42
|
+
if (!((_c = this.config) === null || _c === void 0 ? void 0 : _c.username) || !((_d = this.config) === null || _d === void 0 ? void 0 : _d.password)) {
|
|
43
|
+
this.log.error('Can not start without username or password. Please open config.');
|
|
47
44
|
}
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
else {
|
|
46
|
+
try {
|
|
47
|
+
this.log.debug(`Try to login with username ${this.config.username}.`);
|
|
48
|
+
yield comfortCloudClient.login(this.config.username, this.config.password);
|
|
49
|
+
this.log.info('Login successful.');
|
|
50
|
+
this.setState('info.connection', true, true);
|
|
51
|
+
this.log.debug('Create devices.');
|
|
52
|
+
const groups = yield comfortCloudClient.getGroups();
|
|
53
|
+
yield this.createDevices(groups);
|
|
54
|
+
this.setupRefreshTimeout();
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
yield this.handleClientError(error);
|
|
58
|
+
}
|
|
50
59
|
}
|
|
51
60
|
});
|
|
52
61
|
}
|
|
53
62
|
refreshDeviceStates(device) {
|
|
54
|
-
this
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
63
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
64
|
+
this.log.debug(`Refresh device ${device.name} (${device.guid}).`);
|
|
65
|
+
this.log.debug(`${device.name}: guid => ${device.guid}.`);
|
|
66
|
+
this.log.debug(`${device.name}: operate => ${device.operate}.`);
|
|
67
|
+
yield this.setStateChangedAsync(`${device.name}.operate`, device.operate, true);
|
|
68
|
+
this.log.debug(`${device.name}: temperatureSet => ${device.temperatureSet}.`);
|
|
69
|
+
yield this.setStateChangedAsync(`${device.name}.temperatureSet`, device.temperatureSet, true);
|
|
70
|
+
this.log.debug(`${device.name}: insideTemperature => ${device.insideTemperature}.`);
|
|
71
|
+
yield this.setStateChangedAsync(`${device.name}.insideTemperature`, device.insideTemperature, true);
|
|
72
|
+
this.log.debug(`${device.name}: outTemperature => ${device.outTemperature}.`);
|
|
73
|
+
yield this.setStateChangedAsync(`${device.name}.outTemperature`, device.outTemperature, true);
|
|
74
|
+
this.log.debug(`${device.name}: airSwingLR => ${device.airSwingLR}.`);
|
|
75
|
+
yield this.setStateChangedAsync(`${device.name}.airSwingLR`, device.airSwingLR, true);
|
|
76
|
+
this.log.debug(`${device.name}: airSwingUD => ${device.airSwingUD}.`);
|
|
77
|
+
yield this.setStateChangedAsync(`${device.name}.airSwingUD`, device.airSwingUD, true);
|
|
78
|
+
this.log.debug(`${device.name}: fanAutoMode => ${device.fanAutoMode}.`);
|
|
79
|
+
yield this.setStateChangedAsync(`${device.name}.fanAutoMode`, device.fanAutoMode, true);
|
|
80
|
+
this.log.debug(`${device.name}: ecoMode => ${device.ecoMode}.`);
|
|
81
|
+
yield this.setStateChangedAsync(`${device.name}.ecoMode`, device.ecoMode, true);
|
|
82
|
+
this.log.debug(`${device.name}: operationMode => ${device.operationMode}.`);
|
|
83
|
+
yield this.setStateChangedAsync(`${device.name}.operationMode`, device.operationMode, true);
|
|
84
|
+
this.log.debug(`${device.name}: fanSpeed => ${device.fanSpeed}.`);
|
|
85
|
+
yield this.setStateChangedAsync(`${device.name}.fanSpeed`, device.fanSpeed, true);
|
|
86
|
+
this.log.debug(`${device.name}: actualNanoe => ${device.actualNanoe}.`);
|
|
87
|
+
yield this.setStateChangedAsync(`${device.name}.actualNanoe`, device.actualNanoe, true);
|
|
88
|
+
this.log.debug(`Refresh device ${device.name} finished.`);
|
|
89
|
+
});
|
|
80
90
|
}
|
|
81
91
|
refreshDevice(guid, deviceName) {
|
|
82
92
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -88,10 +98,10 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
88
98
|
if (!device.name) {
|
|
89
99
|
device.name = deviceName;
|
|
90
100
|
}
|
|
91
|
-
this.refreshDeviceStates(device);
|
|
101
|
+
yield this.refreshDeviceStates(device);
|
|
92
102
|
}
|
|
93
103
|
catch (error) {
|
|
94
|
-
this.handleClientError(error);
|
|
104
|
+
yield this.handleClientError(error);
|
|
95
105
|
}
|
|
96
106
|
});
|
|
97
107
|
}
|
|
@@ -100,6 +110,7 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
100
110
|
try {
|
|
101
111
|
this.log.debug('Refresh all devices.');
|
|
102
112
|
const groups = yield comfortCloudClient.getGroups();
|
|
113
|
+
this.setState('info.connection', true, true);
|
|
103
114
|
const devices = _.flatMap(groups, g => g.devices);
|
|
104
115
|
const deviceInfos = _.map(devices, d => { return { guid: d.guid, name: d.name }; });
|
|
105
116
|
yield Promise.all(deviceInfos.map((deviceInfo) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -107,12 +118,12 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
107
118
|
if (device != null) {
|
|
108
119
|
device.name = deviceInfo.name;
|
|
109
120
|
device.guid = deviceInfo.guid;
|
|
110
|
-
this.refreshDeviceStates(device);
|
|
121
|
+
yield this.refreshDeviceStates(device);
|
|
111
122
|
}
|
|
112
123
|
})));
|
|
113
124
|
}
|
|
114
125
|
catch (error) {
|
|
115
|
-
this.handleClientError(error);
|
|
126
|
+
yield this.handleClientError(error);
|
|
116
127
|
}
|
|
117
128
|
});
|
|
118
129
|
}
|
|
@@ -131,20 +142,21 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
131
142
|
device = yield comfortCloudClient.getDevice(deviceInfo.guid);
|
|
132
143
|
}
|
|
133
144
|
catch (error) {
|
|
134
|
-
this.handleClientError(error);
|
|
145
|
+
yield this.handleClientError(error);
|
|
135
146
|
}
|
|
136
147
|
if (device != null) {
|
|
137
148
|
if (_.includes(names, deviceInfo.name)) {
|
|
138
149
|
return;
|
|
139
150
|
}
|
|
140
151
|
this.createDevice(deviceInfo.name);
|
|
141
|
-
this.createState(deviceInfo.name, '', 'guid', { role: '
|
|
152
|
+
this.createState(deviceInfo.name, '', 'guid', { role: 'info.address', write: false, def: deviceInfo.guid, type: 'string' }, undefined);
|
|
153
|
+
this.readonlyStateNames.push('guid');
|
|
142
154
|
this.createState(deviceInfo.name, '', 'operate', {
|
|
143
|
-
role: '
|
|
155
|
+
role: 'switch.power',
|
|
144
156
|
states: { 0: panasonic_comfort_cloud_client_1.Power[0], 1: panasonic_comfort_cloud_client_1.Power[1] },
|
|
145
157
|
write: true,
|
|
146
158
|
def: device.operate,
|
|
147
|
-
type: '
|
|
159
|
+
type: 'number',
|
|
148
160
|
}, undefined);
|
|
149
161
|
this.createState(deviceInfo.name, '', 'temperatureSet', {
|
|
150
162
|
role: 'level.temperature',
|
|
@@ -153,17 +165,19 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
153
165
|
type: 'number',
|
|
154
166
|
}, undefined);
|
|
155
167
|
this.createState(deviceInfo.name, '', 'insideTemperature', {
|
|
156
|
-
role: '
|
|
168
|
+
role: 'level.temperature',
|
|
157
169
|
write: false,
|
|
158
170
|
def: device.insideTemperature,
|
|
159
171
|
type: 'number',
|
|
160
172
|
}, undefined);
|
|
173
|
+
this.readonlyStateNames.push('insideTemperature');
|
|
161
174
|
this.createState(deviceInfo.name, '', 'outTemperature', {
|
|
162
|
-
role: '
|
|
175
|
+
role: 'level.temperature',
|
|
163
176
|
write: false,
|
|
164
177
|
def: device.outTemperature,
|
|
165
178
|
type: 'number',
|
|
166
179
|
}, undefined);
|
|
180
|
+
this.readonlyStateNames.push('outTemperature');
|
|
167
181
|
this.createState(deviceInfo.name, '', 'airSwingLR', {
|
|
168
182
|
role: 'state',
|
|
169
183
|
states: {
|
|
@@ -175,7 +189,7 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
175
189
|
},
|
|
176
190
|
write: true,
|
|
177
191
|
def: device.airSwingLR,
|
|
178
|
-
type: '
|
|
192
|
+
type: 'number',
|
|
179
193
|
}, undefined);
|
|
180
194
|
this.createState(deviceInfo.name, '', 'airSwingUD', {
|
|
181
195
|
role: 'state',
|
|
@@ -188,7 +202,7 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
188
202
|
},
|
|
189
203
|
write: true,
|
|
190
204
|
def: device.airSwingUD,
|
|
191
|
-
type: '
|
|
205
|
+
type: 'number',
|
|
192
206
|
}, undefined);
|
|
193
207
|
this.createState(deviceInfo.name, '', 'fanAutoMode', {
|
|
194
208
|
role: 'state',
|
|
@@ -200,14 +214,14 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
200
214
|
},
|
|
201
215
|
write: true,
|
|
202
216
|
def: device.fanAutoMode,
|
|
203
|
-
type: '
|
|
217
|
+
type: 'number',
|
|
204
218
|
}, undefined);
|
|
205
219
|
this.createState(deviceInfo.name, '', 'ecoMode', {
|
|
206
220
|
role: 'state',
|
|
207
221
|
states: { 0: panasonic_comfort_cloud_client_1.EcoMode[0], 1: panasonic_comfort_cloud_client_1.EcoMode[1], 2: panasonic_comfort_cloud_client_1.EcoMode[2] },
|
|
208
222
|
write: true,
|
|
209
223
|
def: device.ecoMode,
|
|
210
|
-
type: '
|
|
224
|
+
type: 'number',
|
|
211
225
|
}, undefined);
|
|
212
226
|
this.createState(deviceInfo.name, '', 'operationMode', {
|
|
213
227
|
role: 'state',
|
|
@@ -220,7 +234,7 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
220
234
|
},
|
|
221
235
|
write: true,
|
|
222
236
|
def: device.operationMode,
|
|
223
|
-
type: '
|
|
237
|
+
type: 'number',
|
|
224
238
|
}, undefined);
|
|
225
239
|
this.createState(deviceInfo.name, '', 'fanSpeed', {
|
|
226
240
|
role: 'state',
|
|
@@ -234,7 +248,7 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
234
248
|
},
|
|
235
249
|
write: true,
|
|
236
250
|
def: device.fanSpeed,
|
|
237
|
-
type: '
|
|
251
|
+
type: 'number',
|
|
238
252
|
}, undefined);
|
|
239
253
|
this.createState(deviceInfo.name, '', 'actualNanoe', {
|
|
240
254
|
role: 'state',
|
|
@@ -247,7 +261,7 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
247
261
|
},
|
|
248
262
|
write: true,
|
|
249
263
|
def: device.actualNanoe,
|
|
250
|
-
type: '
|
|
264
|
+
type: 'number',
|
|
251
265
|
}, undefined);
|
|
252
266
|
this.log.info(`Device ${deviceInfo.name} created.`);
|
|
253
267
|
}
|
|
@@ -257,7 +271,7 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
257
271
|
}
|
|
258
272
|
updateDevice(deviceName, stateName, state) {
|
|
259
273
|
return __awaiter(this, void 0, void 0, function* () {
|
|
260
|
-
if (stateName
|
|
274
|
+
if (this.readonlyStateNames.includes(stateName)) {
|
|
261
275
|
return;
|
|
262
276
|
}
|
|
263
277
|
if (!state.ack) {
|
|
@@ -280,7 +294,7 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
280
294
|
yield this.refreshDevice(guidState === null || guidState === void 0 ? void 0 : guidState.val, deviceName);
|
|
281
295
|
}
|
|
282
296
|
catch (error) {
|
|
283
|
-
this.handleClientError(error);
|
|
297
|
+
yield this.handleClientError(error);
|
|
284
298
|
}
|
|
285
299
|
}
|
|
286
300
|
});
|
|
@@ -289,10 +303,10 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
289
303
|
* Is called when adapter shuts down - callback has to be called under any circumstances!
|
|
290
304
|
*/
|
|
291
305
|
onUnload(callback) {
|
|
292
|
-
var _a;
|
|
293
306
|
try {
|
|
307
|
+
if (this.refreshTimeout)
|
|
308
|
+
clearTimeout(this.refreshTimeout);
|
|
294
309
|
this.log.info('cleaned everything up...');
|
|
295
|
-
(_a = this.refreshJob) === null || _a === void 0 ? void 0 : _a.cancel();
|
|
296
310
|
callback();
|
|
297
311
|
}
|
|
298
312
|
catch (e) {
|
|
@@ -316,28 +330,38 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
316
330
|
* Is called if a subscribed state changes
|
|
317
331
|
*/
|
|
318
332
|
onStateChange(id, state) {
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
333
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
334
|
+
if (state) {
|
|
335
|
+
const elements = id.split('.');
|
|
336
|
+
const deviceName = elements[elements.length - 2];
|
|
337
|
+
const stateName = elements[elements.length - 1];
|
|
338
|
+
try {
|
|
339
|
+
yield this.updateDevice(deviceName, stateName, state);
|
|
340
|
+
}
|
|
341
|
+
catch (error) {
|
|
342
|
+
yield this.handleClientError(error);
|
|
343
|
+
}
|
|
344
|
+
// The state was changed
|
|
345
|
+
this.log.info(`state ${id} changed: ${state.val} (ack = ${state.ack})`);
|
|
346
|
+
}
|
|
347
|
+
else {
|
|
348
|
+
// The state was deleted
|
|
349
|
+
this.log.info(`state ${id} deleted`);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
331
352
|
}
|
|
332
353
|
handleClientError(error) {
|
|
333
354
|
return __awaiter(this, void 0, void 0, function* () {
|
|
334
355
|
this.log.debug('Try to handle error.');
|
|
335
356
|
if (error instanceof panasonic_comfort_cloud_client_1.TokenExpiredError) {
|
|
336
357
|
this.log.info(`Token of comfort cloud client expired. Trying to login again. Code=${error.code}. Stack: ${error.stack}`);
|
|
358
|
+
this.setState('info.connection', false, true);
|
|
337
359
|
yield comfortCloudClient.login(this.config.username, this.config.password);
|
|
360
|
+
this.setState('info.connection', true, true);
|
|
338
361
|
this.log.info('Login successful.');
|
|
339
362
|
}
|
|
340
363
|
else if (error instanceof panasonic_comfort_cloud_client_1.ServiceError) {
|
|
364
|
+
this.setState('info.connection', false, true);
|
|
341
365
|
this.log.error(`Service error: ${error.message}. Code=${error.code}. Stack: ${error.stack}`);
|
|
342
366
|
}
|
|
343
367
|
else if (error instanceof Error) {
|
|
@@ -345,6 +369,24 @@ class PanasonicComfortCloud extends utils.Adapter {
|
|
|
345
369
|
}
|
|
346
370
|
});
|
|
347
371
|
}
|
|
372
|
+
setupRefreshTimeout() {
|
|
373
|
+
this.log.debug('setupRefreshTimeout');
|
|
374
|
+
const refreshIntervalInMilliseconds = this.refreshIntervalInMinutes * 60 * 1000;
|
|
375
|
+
this.log.debug(`refreshIntervalInMilliseconds=${refreshIntervalInMilliseconds}`);
|
|
376
|
+
this.refreshTimeout = setTimeout(this.refreshTimeoutFunc.bind(this), refreshIntervalInMilliseconds);
|
|
377
|
+
}
|
|
378
|
+
refreshTimeoutFunc() {
|
|
379
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
380
|
+
this.log.debug(`refreshTimeoutFunc started.`);
|
|
381
|
+
try {
|
|
382
|
+
yield this.refreshDevices();
|
|
383
|
+
this.setupRefreshTimeout();
|
|
384
|
+
}
|
|
385
|
+
catch (error) {
|
|
386
|
+
yield this.handleClientError(error);
|
|
387
|
+
}
|
|
388
|
+
});
|
|
389
|
+
}
|
|
348
390
|
}
|
|
349
391
|
if (module.parent) {
|
|
350
392
|
// Export the constructor in compact mode
|
package/io-package.json
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"common": {
|
|
3
3
|
"name": "panasonic-comfort-cloud",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.2",
|
|
5
5
|
"news": {
|
|
6
|
+
"2.0.2": {
|
|
7
|
+
"en": "panasonic-comfort-cloud-client updated to new version.",
|
|
8
|
+
"de": "panasonic-comfort-cloud-client auf die neue Version aktualisiert."
|
|
9
|
+
},
|
|
10
|
+
"2.0.1": {
|
|
11
|
+
"en": "Changed the type of some states from string to number.",
|
|
12
|
+
"de": "Den Typ von einigen States von string zu number geändert."
|
|
13
|
+
},
|
|
14
|
+
"2.0.0": {
|
|
15
|
+
"en": "Added js-controller 3 dependency.\nAdded username and password to protectedNative and password to encryptedNative.\nAdded connection info.\nChanged schdule to timeout for refresh.\nFixes for async await pattern.",
|
|
16
|
+
"de": "js-controller 3 als Abhängigkeit eingefügt.\nusername und password zu protectedNative und password zu encryptedNative hinzugefügt.\nconnection info als Status eingefügt.\nSchudle durch timeout für die Geräteaktualisierung erstezt.\nAsync und await überall korrekt berücksichtig."
|
|
17
|
+
},
|
|
6
18
|
"1.2.9": {
|
|
7
19
|
"en": "Error handling for get device added.",
|
|
8
20
|
"de": "Fehlerbehandlung beim Abrufen des Geräts hinzugefügt."
|
|
@@ -113,17 +125,51 @@
|
|
|
113
125
|
"type": "climate-control",
|
|
114
126
|
"compact": true,
|
|
115
127
|
"materialize": true,
|
|
128
|
+
"globalDependencies": [
|
|
129
|
+
{
|
|
130
|
+
"admin": ">=4.0.9"
|
|
131
|
+
}
|
|
132
|
+
],
|
|
116
133
|
"dependencies": [
|
|
117
134
|
{
|
|
118
|
-
"js-controller": ">=
|
|
135
|
+
"js-controller": ">=3.0.0"
|
|
119
136
|
}
|
|
120
137
|
]
|
|
121
138
|
},
|
|
122
139
|
"native": {
|
|
123
140
|
"username": "",
|
|
124
|
-
"password": ""
|
|
141
|
+
"password": "",
|
|
142
|
+
"refreshInterval": 5
|
|
125
143
|
},
|
|
126
|
-
"protectedNative": [
|
|
144
|
+
"protectedNative": [
|
|
145
|
+
"username",
|
|
146
|
+
"password"
|
|
147
|
+
],
|
|
148
|
+
"encryptedNative": [
|
|
149
|
+
"password"
|
|
150
|
+
],
|
|
127
151
|
"objects": [],
|
|
128
|
-
"instanceObjects": [
|
|
152
|
+
"instanceObjects": [
|
|
153
|
+
{
|
|
154
|
+
"_id": "info",
|
|
155
|
+
"type": "channel",
|
|
156
|
+
"common": {
|
|
157
|
+
"name": "Information"
|
|
158
|
+
},
|
|
159
|
+
"native": {}
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"_id": "info.connection",
|
|
163
|
+
"type": "state",
|
|
164
|
+
"common": {
|
|
165
|
+
"role": "indicator.connected",
|
|
166
|
+
"name": "Device or service connected",
|
|
167
|
+
"type": "boolean",
|
|
168
|
+
"read": true,
|
|
169
|
+
"write": false,
|
|
170
|
+
"def": false
|
|
171
|
+
},
|
|
172
|
+
"native": {}
|
|
173
|
+
}
|
|
174
|
+
]
|
|
129
175
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "iobroker.panasonic-comfort-cloud",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Adapter for Panasonic Comfort Cloud",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "marc",
|
|
@@ -16,16 +16,14 @@
|
|
|
16
16
|
"url": "https://github.com/marc2016/ioBroker.panasonic-comfort-cloud"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@iobroker/adapter-core": "^2.
|
|
19
|
+
"@iobroker/adapter-core": "^2.5.1",
|
|
20
20
|
"@types/lodash": "^4.14.149",
|
|
21
|
-
"@types/node-schedule": "^1.3.0",
|
|
22
21
|
"lodash": "^4.17.15",
|
|
23
|
-
"
|
|
24
|
-
"panasonic-comfort-cloud-client": "^1.1.4",
|
|
22
|
+
"panasonic-comfort-cloud-client": "^1.1.5",
|
|
25
23
|
"ts-enum-util": "^4.0.1"
|
|
26
24
|
},
|
|
27
25
|
"devDependencies": {
|
|
28
|
-
"@iobroker/testing": "^
|
|
26
|
+
"@iobroker/testing": "^2.5.4",
|
|
29
27
|
"@types/chai": "^4.2.4",
|
|
30
28
|
"@types/chai-as-promised": "^7.1.2",
|
|
31
29
|
"@types/gulp": "^4.0.6",
|
|
@@ -48,7 +46,7 @@
|
|
|
48
46
|
"sinon-chai": "^3.3.0",
|
|
49
47
|
"source-map-support": "^0.5.16",
|
|
50
48
|
"ts-node": "^8.4.1",
|
|
51
|
-
"typescript": "^
|
|
49
|
+
"typescript": "^4.5.4"
|
|
52
50
|
},
|
|
53
51
|
"main": "build/main.js",
|
|
54
52
|
"scripts": {
|
|
@@ -60,7 +58,7 @@
|
|
|
60
58
|
"test:ts": "mocha --opts test/mocha.custom.opts",
|
|
61
59
|
"test:package": "mocha test/package --exit",
|
|
62
60
|
"test:unit": "mocha test/unit --exit",
|
|
63
|
-
"test:integration": "mocha test/integration --exit",
|
|
61
|
+
"test:integration": "mocha test/integration --timeout 120000 --exit",
|
|
64
62
|
"test": "npm run test:ts && npm run test:package",
|
|
65
63
|
"lint": "eslint --ext .ts src"
|
|
66
64
|
},
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: Bug report
|
|
3
|
-
about: Something is not working as it should
|
|
4
|
-
title: ''
|
|
5
|
-
labels: ''
|
|
6
|
-
assignees: ''
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
**Describe the bug**
|
|
10
|
-
A clear and concise description of what the bug is.
|
|
11
|
-
|
|
12
|
-
**To Reproduce**
|
|
13
|
-
Steps to reproduce the behavior:
|
|
14
|
-
1. Go to '...'
|
|
15
|
-
2. Click on '...'
|
|
16
|
-
3. Scroll down to '....'
|
|
17
|
-
4. See error
|
|
18
|
-
|
|
19
|
-
**Expected behavior**
|
|
20
|
-
A clear and concise description of what you expected to happen.
|
|
21
|
-
|
|
22
|
-
**Screenshots & Logfiles**
|
|
23
|
-
If applicable, add screenshots and logfiles to help explain your problem.
|
|
24
|
-
|
|
25
|
-
**Versions:**
|
|
26
|
-
- Adapter version: <adapter-version>
|
|
27
|
-
- JS-Controller version: <js-controller-version> <!-- determine this with `iobroker -v` on the console -->
|
|
28
|
-
- Node version: <node-version> <!-- determine this with `node -v` on the console -->
|
|
29
|
-
- Operating system: <os-name>
|
|
30
|
-
|
|
31
|
-
**Additional context**
|
|
32
|
-
Add any other context about the problem here.
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
name: Test and Release
|
|
2
|
-
|
|
3
|
-
# Run this job on all pushes and pull requests
|
|
4
|
-
# as well as tags with a semantic version
|
|
5
|
-
on:
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- "*"
|
|
9
|
-
tags:
|
|
10
|
-
# normal versions
|
|
11
|
-
- "v[0-9]+.[0-9]+.[0-9]+"
|
|
12
|
-
# pre-releases
|
|
13
|
-
- "v[0-9]+.[0-9]+.[0-9]+-**"
|
|
14
|
-
pull_request: {}
|
|
15
|
-
|
|
16
|
-
jobs:
|
|
17
|
-
# Performs quick checks before the expensive test runs
|
|
18
|
-
check-and-lint:
|
|
19
|
-
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
|
20
|
-
|
|
21
|
-
runs-on: ubuntu-latest
|
|
22
|
-
|
|
23
|
-
steps:
|
|
24
|
-
- uses: ioBroker/testing-action-check@v1
|
|
25
|
-
with:
|
|
26
|
-
node-version: '14.x'
|
|
27
|
-
lint: true
|
|
28
|
-
|
|
29
|
-
adapter-tests:
|
|
30
|
-
if: contains(github.event.head_commit.message, '[skip ci]') == false
|
|
31
|
-
|
|
32
|
-
runs-on: ${{ matrix.os }}
|
|
33
|
-
strategy:
|
|
34
|
-
matrix:
|
|
35
|
-
node-version: [12.x, 14.x, 16.x]
|
|
36
|
-
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
37
|
-
|
|
38
|
-
steps:
|
|
39
|
-
- uses: ioBroker/testing-action-adapter@v1
|
|
40
|
-
with:
|
|
41
|
-
node-version: ${{ matrix.node-version }}
|
|
42
|
-
os: ${{ matrix.os }}
|
|
43
|
-
|
|
44
|
-
deploy:
|
|
45
|
-
needs: [check-and-lint, adapter-tests]
|
|
46
|
-
|
|
47
|
-
if: |
|
|
48
|
-
contains(github.event.head_commit.message, '[skip ci]') == false &&
|
|
49
|
-
github.event_name == 'push' &&
|
|
50
|
-
startsWith(github.ref, 'refs/tags/v')
|
|
51
|
-
|
|
52
|
-
runs-on: ubuntu-latest
|
|
53
|
-
|
|
54
|
-
steps:
|
|
55
|
-
- uses: ioBroker/testing-action-deploy@v1
|
|
56
|
-
with:
|
|
57
|
-
node-version: '14.x'
|
|
58
|
-
npm-token: ${{ secrets.NPM_TOKEN }}
|
|
59
|
-
github-token: ${{ secrets.GITHUB_TOKEN }}
|