iobroker.hue 3.12.0 → 3.13.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/README.md +6 -0
- package/admin/i18n/de/translations.json +7 -5
- package/admin/i18n/en/translations.json +4 -3
- package/admin/i18n/es/translations.json +1 -1
- package/admin/i18n/fr/translations.json +1 -1
- package/admin/i18n/it/translations.json +1 -1
- package/admin/i18n/nl/translations.json +1 -1
- package/admin/i18n/pl/translations.json +1 -1
- package/admin/i18n/pt/translations.json +1 -1
- package/admin/i18n/ru/translations.json +1 -1
- package/admin/i18n/zh-cn/translations.json +1 -1
- package/admin/jsonConfig.json +170 -0
- package/build/lib/constants.d.ts +4 -0
- package/build/lib/constants.js +8 -0
- package/build/lib/constants.js.map +1 -0
- package/build/main.js +24 -10
- package/build/main.js.map +1 -1
- package/io-package.json +35 -30
- package/package.json +9 -9
- package/admin/index.html +0 -211
- package/admin/index_m.html +0 -296
- package/admin/instruction.png +0 -0
package/README.md
CHANGED
|
@@ -74,6 +74,12 @@ In den Adapter-Settings muss die IP der Hue Bridge sowie ein Username konfigurie
|
|
|
74
74
|
Placeholder for the next version (at the beginning of the line):
|
|
75
75
|
### __WORK IN PROGRESS__
|
|
76
76
|
-->
|
|
77
|
+
### 3.13.1 (2024-10-16)
|
|
78
|
+
* (@foxriver76) correct min color temperature to 2000 (valid for color lights) instead of 2200
|
|
79
|
+
|
|
80
|
+
### 3.13.0 (2024-10-16)
|
|
81
|
+
* (@Jey-Cee) optimized settings page for mobile devices (ported to json-config)
|
|
82
|
+
|
|
77
83
|
### 3.12.0 (2024-07-14)
|
|
78
84
|
* (foxriver76) `level` and `bri` states of groups are now updated via push API
|
|
79
85
|
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"\"Legacy\" structure": "\"Legacy\"-Struktur",
|
|
3
3
|
"Auto setup": "Automatisches Setup",
|
|
4
4
|
"Bridge Address": "Bridge-Adresse",
|
|
5
|
+
"Help bridge address": "Es wird automatisch nach einer Bridge gesucht, dieser Vorgang dauert etwa 5-10 Sekunden. Der Adapter muss dafür gestartet sein.",
|
|
5
6
|
"Bridge User": "Bridge-Benutzer",
|
|
6
7
|
"Bridge port": "Bridge-Port",
|
|
7
8
|
"Cannot find bridge": "Kann keine Bridge finden",
|
|
@@ -11,20 +12,21 @@
|
|
|
11
12
|
"Find Bridge": "Bridge suchen",
|
|
12
13
|
"Ignore groups": "Gruppen ignorieren",
|
|
13
14
|
"Ignore scenes": "Szenen ignorieren",
|
|
14
|
-
"Instruction": "Bitte Link-
|
|
15
|
+
"Instruction": "Bitte drücken Sie den Link-Button der Brücke, bevor Sie einen neuen Benutzer anlegen!",
|
|
15
16
|
"Minimal polling interval is 2 seconds": "Das minimale Abfrageintervall beträgt 2 Sekunden",
|
|
16
17
|
"Native turn off/on behaviour": "Natives Ein- und Ausschaltverhalten",
|
|
17
18
|
"Ok": "Ok",
|
|
18
19
|
"Philips HUE adapter settings": "Philips HUE Adaptereinstellungen",
|
|
19
20
|
"Please wait, searching for bridge.": "Bitte warten, suche nach Bridge.",
|
|
20
21
|
"Polling": "Polling",
|
|
21
|
-
"Polling interval (sec)": "Abfrageintervall (
|
|
22
|
+
"Polling interval (sec)": "Abfrageintervall (Sek.)",
|
|
22
23
|
"Select a bridge:": "Wähle eine Bridge aus:",
|
|
23
24
|
"Settings": "Einstellungen",
|
|
24
25
|
"Sync software sensors": "Software-Sensoren synchronisieren",
|
|
25
|
-
"error creating user: ": "Fehler beim Erzeugen des Benutzers:
|
|
26
|
-
"error finding bridge": "Fehler beim Finden der
|
|
26
|
+
"error creating user: ": "Fehler beim Erzeugen des Benutzers:",
|
|
27
|
+
"error finding bridge": "Fehler beim Finden der Bridge",
|
|
27
28
|
"ignoreOsram": "ignoriere Osram",
|
|
28
29
|
"link button not pressed": "Link-Knopf nicht gedrückt",
|
|
29
|
-
"polling_warning": "Hinweis: Der Adapter kann nur 10 Befehle in 1 Sekunde senden."
|
|
30
|
+
"polling_warning": "Hinweis: Der Adapter kann nur 10 Befehle in 1 Sekunde senden.",
|
|
31
|
+
"Turn on with others": "Schaltet das Gerät mit anderen Funktionen als Leistung und Helligkeit ein"
|
|
30
32
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
"\"Legacy\" structure": "\"Legacy\" structure",
|
|
3
3
|
"Auto setup": "Auto setup",
|
|
4
4
|
"Bridge Address": "Bridge Address",
|
|
5
|
+
"Help bridge address": "It will automatically search for a bridge, this process takes about 5-10 seconds. The adapter must be started for this.",
|
|
5
6
|
"Bridge User": "Bridge User",
|
|
6
7
|
"Bridge port": "Bridge port",
|
|
7
8
|
"Cannot find bridge": "Cannot find bridge",
|
|
@@ -11,7 +12,7 @@
|
|
|
11
12
|
"Find Bridge": "Find Bridge",
|
|
12
13
|
"Ignore groups": "Ignore groups",
|
|
13
14
|
"Ignore scenes": "Ignore scenes",
|
|
14
|
-
"Instruction": "Please press link button
|
|
15
|
+
"Instruction": "Please press the link button of the bridge before create a new user!",
|
|
15
16
|
"Minimal polling interval is 2 seconds": "Minimal polling interval is 2 seconds",
|
|
16
17
|
"Native turn off/on behaviour": "Native turn off/on behaviour",
|
|
17
18
|
"Ok": "Ok",
|
|
@@ -22,10 +23,10 @@
|
|
|
22
23
|
"Select a bridge:": "Select a bridge:",
|
|
23
24
|
"Settings": "Settings",
|
|
24
25
|
"Sync software sensors": "Sync software sensors",
|
|
25
|
-
"error creating user: ": "error creating user:
|
|
26
|
+
"error creating user: ": "error creating user:",
|
|
26
27
|
"error finding bridge": "error finding bridge",
|
|
27
28
|
"ignoreOsram": "ignore Osram",
|
|
28
29
|
"link button not pressed": "link button not pressed",
|
|
29
30
|
"polling_warning": "Notice: Adapter may send only 10 commands in 1 second.",
|
|
30
31
|
"Turn on with others": "Turn on with others than power and brightness"
|
|
31
|
-
}
|
|
32
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Find Bridge": "Find Bridge",
|
|
12
12
|
"Ignore groups": "Ignorar grupos",
|
|
13
13
|
"Ignore scenes": "Ignorar escenas",
|
|
14
|
-
"Instruction": "
|
|
14
|
+
"Instruction": "Pulse el botón de enlace del puente antes de crear un nuevo usuario.",
|
|
15
15
|
"Minimal polling interval is 2 seconds": "El intervalo mínimo de sondeo es de 2 segundos.",
|
|
16
16
|
"Native turn off/on behaviour": "Comportamiento nativo de apagado / encendido",
|
|
17
17
|
"Ok": "Ok",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Find Bridge": "Find Bridge",
|
|
12
12
|
"Ignore groups": "Ignorer les groupes",
|
|
13
13
|
"Ignore scenes": "Ignorer les scènes",
|
|
14
|
-
"Instruction": "
|
|
14
|
+
"Instruction": "Veuillez appuyer sur le bouton de liaison du pont avant de créer un nouvel utilisateur !",
|
|
15
15
|
"Minimal polling interval is 2 seconds": "L'intervalle d'interrogation minimal est de 2 secondes",
|
|
16
16
|
"Native turn off/on behaviour": "Comportement natif d'activation / désactivation",
|
|
17
17
|
"Ok": "Ok",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Find Bridge": "Find Bridge",
|
|
12
12
|
"Ignore groups": "Ignora gruppi",
|
|
13
13
|
"Ignore scenes": "Ignora le scene",
|
|
14
|
-
"Instruction": "
|
|
14
|
+
"Instruction": "Prima di creare un nuovo utente, premere il pulsante di collegamento del ponte!",
|
|
15
15
|
"Minimal polling interval is 2 seconds": "L'intervallo di polling minimo è di 2 secondi",
|
|
16
16
|
"Native turn off/on behaviour": "Disattivazione / attivazione nativa del comportamento",
|
|
17
17
|
"Ok": "Ok",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Find Bridge": "Find Bridge",
|
|
12
12
|
"Ignore groups": "Negeer groepen",
|
|
13
13
|
"Ignore scenes": "Negeer scènes",
|
|
14
|
-
"Instruction": "
|
|
14
|
+
"Instruction": "Druk op de linkknop van de brug voordat je een nieuwe gebruiker aanmaakt!",
|
|
15
15
|
"Minimal polling interval is 2 seconds": "Minimaal polling-interval is 2 seconden",
|
|
16
16
|
"Native turn off/on behaviour": "Eigen in- / uitschakelgedrag",
|
|
17
17
|
"Ok": "Ok",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Find Bridge": "Find Bridge",
|
|
12
12
|
"Ignore groups": "Ignoruj grupy",
|
|
13
13
|
"Ignore scenes": "Ignoruj sceny",
|
|
14
|
-
"Instruction": "
|
|
14
|
+
"Instruction": "Przed utworzeniem nowego użytkownika należy nacisnąć przycisk łącza mostu!",
|
|
15
15
|
"Minimal polling interval is 2 seconds": "Minimalny interwał odpytywania wynosi 2 sekundy",
|
|
16
16
|
"Native turn off/on behaviour": "Natywne zachowanie wyłączania / włączania",
|
|
17
17
|
"Ok": "Ok",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Find Bridge": "Procurar Bridge",
|
|
12
12
|
"Ignore groups": "Ignorar grupos",
|
|
13
13
|
"Ignore scenes": "Ignorar cenas",
|
|
14
|
-
"Instruction": "
|
|
14
|
+
"Instruction": "Por favor, prima o botão de ligação da ponte antes de criar um novo utilizador!",
|
|
15
15
|
"Minimal polling interval is 2 seconds": "O intervalo mínimo de pesquisa é de 2 segundos",
|
|
16
16
|
"Native turn off/on behaviour": "Comportamento de ativação / desativação nativo",
|
|
17
17
|
"Ok": "Ok",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Find Bridge": "Найти HUE bridge",
|
|
12
12
|
"Ignore groups": "Игнорировать группы",
|
|
13
13
|
"Ignore scenes": "Игнорировать сцены",
|
|
14
|
-
"Instruction": "
|
|
14
|
+
"Instruction": "Перед созданием нового пользователя нажмите кнопку ссылки на мост!",
|
|
15
15
|
"Minimal polling interval is 2 seconds": "Минимальный интервал опроса составляет 2 секунды",
|
|
16
16
|
"Native turn off/on behaviour": "Родное поведение включения / выключения",
|
|
17
17
|
"Ok": "Ok",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"Find Bridge": "找桥",
|
|
12
12
|
"Ignore groups": "忽略组",
|
|
13
13
|
"Ignore scenes": "忽略场景",
|
|
14
|
-
"Instruction": "
|
|
14
|
+
"Instruction": "在创建新用户之前,请按下网桥的链接按钮!",
|
|
15
15
|
"Minimal polling interval is 2 seconds": "最小轮询间隔为2秒",
|
|
16
16
|
"Native turn off/on behaviour": "本机关闭/打开行为",
|
|
17
17
|
"Ok": "确定",
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
{
|
|
2
|
+
"type": "panel",
|
|
3
|
+
"i18n": true,
|
|
4
|
+
"items": {
|
|
5
|
+
"bridge": {
|
|
6
|
+
"type": "autocompleteSendTo",
|
|
7
|
+
"command": "browse",
|
|
8
|
+
"jsonData": "{\"timeout\": 5000}",
|
|
9
|
+
"freeSolo": true,
|
|
10
|
+
"label": "Bridge Address",
|
|
11
|
+
"help": "Help bridge address",
|
|
12
|
+
"xs": 12,
|
|
13
|
+
"sm": 8,
|
|
14
|
+
"md": 6,
|
|
15
|
+
"lg": 4,
|
|
16
|
+
"xl": 4
|
|
17
|
+
},
|
|
18
|
+
"port": {
|
|
19
|
+
"type": "number",
|
|
20
|
+
"label": "Bridge Port",
|
|
21
|
+
"xs": 12,
|
|
22
|
+
"sm": 4,
|
|
23
|
+
"md": 2,
|
|
24
|
+
"lg": 2,
|
|
25
|
+
"xl": 2
|
|
26
|
+
},
|
|
27
|
+
"user": {
|
|
28
|
+
"type": "text",
|
|
29
|
+
"label": "Bridge User",
|
|
30
|
+
"xs": 12,
|
|
31
|
+
"sm": 12,
|
|
32
|
+
"md": 8,
|
|
33
|
+
"lg": 6,
|
|
34
|
+
"xl": 6,
|
|
35
|
+
"newLine": true
|
|
36
|
+
},
|
|
37
|
+
"_instructionText": {
|
|
38
|
+
"type": "staticText",
|
|
39
|
+
"text": "Instruction",
|
|
40
|
+
"style": {
|
|
41
|
+
"fontWeight": "bold",
|
|
42
|
+
"fontSize": "larger",
|
|
43
|
+
"color": "red"
|
|
44
|
+
},
|
|
45
|
+
"xs": 12,
|
|
46
|
+
"sm": 12,
|
|
47
|
+
"md": 4,
|
|
48
|
+
"lg": 3,
|
|
49
|
+
"xl": 4,
|
|
50
|
+
"newLine": true
|
|
51
|
+
},
|
|
52
|
+
"createUserButton": {
|
|
53
|
+
"type": "sendTo",
|
|
54
|
+
"command": "createUser",
|
|
55
|
+
"jsonData": "{\"ip\": \"${data.bridge}\", \"port\": \"${data.port}\"}",
|
|
56
|
+
"error": {
|
|
57
|
+
"Not open": "link button not pressed",
|
|
58
|
+
"Unknown error": "Unknown error"
|
|
59
|
+
},
|
|
60
|
+
"label": "Create User",
|
|
61
|
+
"icon": "add",
|
|
62
|
+
"variant": "contained",
|
|
63
|
+
"showProcess": true,
|
|
64
|
+
"useNative": true,
|
|
65
|
+
"timeout": 15000,
|
|
66
|
+
"help": "Instructions",
|
|
67
|
+
"xs": 12,
|
|
68
|
+
"sm": 12,
|
|
69
|
+
"md": 4,
|
|
70
|
+
"lg": 3,
|
|
71
|
+
"xl": 2
|
|
72
|
+
},
|
|
73
|
+
"_divider": {
|
|
74
|
+
"type": "divider",
|
|
75
|
+
"height": 2
|
|
76
|
+
},
|
|
77
|
+
"ignoreOsram": {
|
|
78
|
+
"type": "checkbox",
|
|
79
|
+
"label": "ignoreOsram",
|
|
80
|
+
"xs": 12,
|
|
81
|
+
"sm": 10,
|
|
82
|
+
"md": 4,
|
|
83
|
+
"lg": 4,
|
|
84
|
+
"xl": 4,
|
|
85
|
+
"newLine": true
|
|
86
|
+
},
|
|
87
|
+
"ignoreGroups": {
|
|
88
|
+
"type": "checkbox",
|
|
89
|
+
"label": "Ignore groups",
|
|
90
|
+
"xs": 12,
|
|
91
|
+
"sm": 10,
|
|
92
|
+
"md": 4,
|
|
93
|
+
"lg": 4,
|
|
94
|
+
"xl": 4
|
|
95
|
+
},
|
|
96
|
+
"ignoreScenes": {
|
|
97
|
+
"type": "checkbox",
|
|
98
|
+
"label": "Ignore scenes",
|
|
99
|
+
"xs": 12,
|
|
100
|
+
"sm": 10,
|
|
101
|
+
"md": 4,
|
|
102
|
+
"lg": 4,
|
|
103
|
+
"xl": 4
|
|
104
|
+
},
|
|
105
|
+
"useLegacyStructure": {
|
|
106
|
+
"type": "checkbox",
|
|
107
|
+
"label": "Legacy structure",
|
|
108
|
+
"xs": 12,
|
|
109
|
+
"sm": 10,
|
|
110
|
+
"md": 4,
|
|
111
|
+
"lg": 4,
|
|
112
|
+
"xl": 4
|
|
113
|
+
},
|
|
114
|
+
"ssl": {
|
|
115
|
+
"type": "checkbox",
|
|
116
|
+
"label": "SSL",
|
|
117
|
+
"xs": 12,
|
|
118
|
+
"sm": 10,
|
|
119
|
+
"md": 4,
|
|
120
|
+
"lg": 4,
|
|
121
|
+
"xl": 4
|
|
122
|
+
},
|
|
123
|
+
"nativeTurnOffBehaviour": {
|
|
124
|
+
"type": "checkbox",
|
|
125
|
+
"label": "Native turn off/on behaviour",
|
|
126
|
+
"xs": 12,
|
|
127
|
+
"sm": 10,
|
|
128
|
+
"md": 4,
|
|
129
|
+
"lg": 4,
|
|
130
|
+
"xl": 4
|
|
131
|
+
},
|
|
132
|
+
"syncSoftwareSensors": {
|
|
133
|
+
"type": "checkbox",
|
|
134
|
+
"label": "Sync software sensors",
|
|
135
|
+
"xs": 12,
|
|
136
|
+
"sm": 10,
|
|
137
|
+
"md": 4,
|
|
138
|
+
"lg": 4,
|
|
139
|
+
"xl": 4
|
|
140
|
+
},
|
|
141
|
+
"turnOnWithOthers": {
|
|
142
|
+
"type": "checkbox",
|
|
143
|
+
"label": "Turn On with Others",
|
|
144
|
+
"xs": 12,
|
|
145
|
+
"sm": 10,
|
|
146
|
+
"md": 4,
|
|
147
|
+
"lg": 4,
|
|
148
|
+
"xl": 4
|
|
149
|
+
},
|
|
150
|
+
"polling": {
|
|
151
|
+
"type": "checkbox",
|
|
152
|
+
"label": "Polling",
|
|
153
|
+
"xs": 12,
|
|
154
|
+
"sm": 10,
|
|
155
|
+
"md": 4,
|
|
156
|
+
"lg": 4,
|
|
157
|
+
"xl": 4
|
|
158
|
+
},
|
|
159
|
+
"pollingInterval": {
|
|
160
|
+
"type": "number",
|
|
161
|
+
"label": "Polling interval (sec)",
|
|
162
|
+
"min": 2,
|
|
163
|
+
"xs": 12,
|
|
164
|
+
"sm": 4,
|
|
165
|
+
"md": 3,
|
|
166
|
+
"lg": 2,
|
|
167
|
+
"xl": 2
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MAX_CT = exports.MIN_CT = void 0;
|
|
4
|
+
/** Minimum color temperature */
|
|
5
|
+
exports.MIN_CT = 2000;
|
|
6
|
+
/** Maximum color temperature */
|
|
7
|
+
exports.MAX_CT = 6500;
|
|
8
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/lib/constants.ts"],"names":[],"mappings":";;;AAAA,gCAAgC;AACnB,QAAA,MAAM,GAAG,IAAK,CAAC;AAC5B,gCAAgC;AACnB,QAAA,MAAM,GAAG,IAAK,CAAC"}
|
package/build/main.js
CHANGED
|
@@ -41,6 +41,7 @@ const hueHelper = __importStar(require("./lib/hueHelper"));
|
|
|
41
41
|
const tools = __importStar(require("./lib/tools"));
|
|
42
42
|
const GroupState_1 = __importDefault(require("node-hue-api/lib/model/lightstate/GroupState"));
|
|
43
43
|
const hue_push_client_1 = __importDefault(require("hue-push-client"));
|
|
44
|
+
const constants_1 = require("./lib/constants");
|
|
44
45
|
/** IDs currently blocked from polling */
|
|
45
46
|
const blockedIds = {};
|
|
46
47
|
/** Map ioBroker channel to light id */
|
|
@@ -131,17 +132,25 @@ class Hue extends utils.Adapter {
|
|
|
131
132
|
if (obj) {
|
|
132
133
|
switch (obj.command) {
|
|
133
134
|
case 'browse': {
|
|
134
|
-
const
|
|
135
|
-
this.
|
|
135
|
+
const timeout = obj.message.timeout;
|
|
136
|
+
const res = await this.browse(timeout);
|
|
136
137
|
if (obj.callback) {
|
|
137
138
|
this.sendTo(obj.from, obj.command, res, obj.callback);
|
|
138
139
|
}
|
|
139
140
|
break;
|
|
140
141
|
}
|
|
141
142
|
case 'createUser': {
|
|
142
|
-
const res = await this.createUser(obj.message);
|
|
143
|
+
const res = await this.createUser(obj.message.ip, obj.message.port);
|
|
143
144
|
if (obj.callback) {
|
|
144
|
-
|
|
145
|
+
if (res.error === 0) {
|
|
146
|
+
this.sendTo(obj.from, obj.command, { user: res.message }, obj.callback);
|
|
147
|
+
}
|
|
148
|
+
else if (res.error === 403) {
|
|
149
|
+
this.sendTo(obj.from, obj.command, { error: 'Not open' }, obj.callback);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
this.sendTo(obj.from, obj.command, { error: 'Unknown error' }, obj.callback);
|
|
153
|
+
}
|
|
145
154
|
}
|
|
146
155
|
break;
|
|
147
156
|
}
|
|
@@ -518,7 +527,7 @@ class Hue extends utils.Adapter {
|
|
|
518
527
|
this.log.error(`Invalid "ct" value "${state.val}" (type: ${typeof ls.ct}) for id "${id}"`);
|
|
519
528
|
return;
|
|
520
529
|
}
|
|
521
|
-
finalLS.ct = Math.max(
|
|
530
|
+
finalLS.ct = Math.max(constants_1.MIN_CT, Math.min(constants_1.MAX_CT, ls.ct));
|
|
522
531
|
finalLS.ct = hueHelper.miredToKelvin(finalLS.ct);
|
|
523
532
|
lightState = lightState.ct(finalLS.ct);
|
|
524
533
|
if (!lampOn && (!('bri' in ls) || ls.bri === 0) && this.config.turnOnWithOthers) {
|
|
@@ -621,7 +630,7 @@ class Hue extends utils.Adapter {
|
|
|
621
630
|
lightState = lightState.hue(finalLS.hue);
|
|
622
631
|
}
|
|
623
632
|
if ('ct_inc' in ls && !('ct' in finalLS) && 'ct' in alls) {
|
|
624
|
-
alls.ct = 500 - 153 - ((alls.ct -
|
|
633
|
+
alls.ct = 500 - 153 - ((alls.ct - constants_1.MIN_CT) / (constants_1.MAX_CT - constants_1.MIN_CT)) * (500 - 153) + 153;
|
|
625
634
|
finalLS.ct = ((((alls.ct - 153 + ls.ct_inc) % 348) + 348) % 348) + 153;
|
|
626
635
|
if (!lampOn && (!('bri' in ls) || ls.bri === 0) && this.config.turnOnWithOthers) {
|
|
627
636
|
lightState = lightState.on(true);
|
|
@@ -771,20 +780,25 @@ class Hue extends utils.Adapter {
|
|
|
771
780
|
ips.push(bridges[i].ipaddress);
|
|
772
781
|
}
|
|
773
782
|
}
|
|
774
|
-
|
|
783
|
+
const ipsWithLabels = ips.map(ip => ({
|
|
784
|
+
value: ip,
|
|
785
|
+
label: ip
|
|
786
|
+
}));
|
|
787
|
+
return ipsWithLabels;
|
|
775
788
|
}
|
|
776
789
|
/**
|
|
777
790
|
* Create user on the bridge by given Ip
|
|
778
791
|
*
|
|
779
792
|
* @param ip - ip address of the bridge
|
|
793
|
+
* @param port - port of the bridge
|
|
780
794
|
*/
|
|
781
|
-
async createUser(ip) {
|
|
795
|
+
async createUser(ip, port) {
|
|
782
796
|
const deviceName = 'ioBroker.hue';
|
|
783
797
|
try {
|
|
784
798
|
const api = this.config.ssl
|
|
785
|
-
? await node_hue_api_1.v3.api.createLocal(ip,
|
|
799
|
+
? await node_hue_api_1.v3.api.createLocal(ip, port).connect()
|
|
786
800
|
: // @ts-expect-error third party types are incorrect
|
|
787
|
-
await node_hue_api_1.v3.api.createInsecureLocal(ip,
|
|
801
|
+
await node_hue_api_1.v3.api.createInsecureLocal(ip, port).connect();
|
|
788
802
|
const newUser = await api.users.createUser(ip, deviceName);
|
|
789
803
|
this.log.info(`created new User: ${newUser.username}`);
|
|
790
804
|
return { error: 0, message: newUser.username };
|