iobroker.zigbee2mqtt 0.2.0 → 2.1.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/README.md +35 -0
- package/admin/i18n/de/translations.json +22 -6
- package/admin/i18n/en/translations.json +20 -4
- package/admin/i18n/es/translations.json +20 -4
- package/admin/i18n/fr/translations.json +20 -4
- package/admin/i18n/it/translations.json +20 -4
- package/admin/i18n/nl/translations.json +20 -4
- package/admin/i18n/pl/translations.json +20 -4
- package/admin/i18n/pt/translations.json +20 -4
- package/admin/i18n/ru/translations.json +20 -4
- package/admin/i18n/zh-cn/translations.json +20 -4
- package/admin/jsonConfig.json +131 -9
- package/io-package.json +59 -7
- package/lib/check.js +36 -0
- package/lib/colors.js +5 -3
- package/lib/deviceController.js +234 -0
- package/lib/exposes.js +90 -45
- package/lib/messages.js +39 -0
- package/lib/mqttServerController.js +42 -0
- package/lib/rgb.js +42 -17
- package/lib/states.js +41 -19
- package/lib/statesController.js +138 -0
- package/lib/utils.js +19 -17
- package/lib/websocketController.js +84 -0
- package/lib/z2mController.js +80 -0
- package/main.js +130 -387
- package/package.json +11 -7
- package/lib/groups.js +0 -68
package/lib/groups.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
const states = require('./states').states;
|
|
2
|
-
const utils = require('./utils');
|
|
3
|
-
|
|
4
|
-
function defineGroupDevice(devices, groupID, ieee_address, scenes, useKelvin) {
|
|
5
|
-
const newDevice = {
|
|
6
|
-
id: groupID,
|
|
7
|
-
ieee_address: ieee_address,
|
|
8
|
-
icon: undefined,
|
|
9
|
-
states: [
|
|
10
|
-
states.state,
|
|
11
|
-
states.brightness,
|
|
12
|
-
states.color,
|
|
13
|
-
states.brightness_move,
|
|
14
|
-
states.colortemp_move,
|
|
15
|
-
],
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const colortemp = {
|
|
19
|
-
id: 'colortemp',
|
|
20
|
-
prop: 'color_temp',
|
|
21
|
-
name: 'Color temperature',
|
|
22
|
-
icon: undefined,
|
|
23
|
-
role: 'level.color.temperature',
|
|
24
|
-
write: true,
|
|
25
|
-
read: true,
|
|
26
|
-
type: 'number',
|
|
27
|
-
unit: useKelvin == true ? 'K' : 'mired',
|
|
28
|
-
setter: (value) => {
|
|
29
|
-
return utils.toMired(value);
|
|
30
|
-
},
|
|
31
|
-
getter: (payload) => {
|
|
32
|
-
if (useKelvin == true) {
|
|
33
|
-
return utils.miredKelvinConversion(payload.color_temp);
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
return payload.color_temp;
|
|
37
|
-
}
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// @ts-ignore
|
|
42
|
-
newDevice.states.push(colortemp);
|
|
43
|
-
|
|
44
|
-
// Create buttons for scenes
|
|
45
|
-
for (const scene of scenes) {
|
|
46
|
-
const sceneSate = {
|
|
47
|
-
id: `scene_${scene.id}`,
|
|
48
|
-
prop: `scene_recall`,
|
|
49
|
-
name: scene.name,
|
|
50
|
-
icon: undefined,
|
|
51
|
-
role: 'button',
|
|
52
|
-
write: true,
|
|
53
|
-
read: true,
|
|
54
|
-
type: 'boolean',
|
|
55
|
-
setter: (value) => (value) ? scene.id : undefined
|
|
56
|
-
};
|
|
57
|
-
// @ts-ignore
|
|
58
|
-
newDevice.states.push(sceneSate);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// if the device is already present in the cache, remove it
|
|
62
|
-
utils.removeDeviceByIeee(devices, ieee_address);
|
|
63
|
-
devices.push(newDevice);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
module.exports = {
|
|
67
|
-
defineGroupDevice: defineGroupDevice,
|
|
68
|
-
};
|