iobroker.hue 3.6.1 → 3.6.3

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 CHANGED
@@ -73,6 +73,9 @@ In den Adapter-Settings muss die IP der Hue Bridge sowie ein Username konfigurie
73
73
  Placeholder for the next version (at the beginning of the line):
74
74
  ### __WORK IN PROGRESS__
75
75
  -->
76
+ ### 3.6.3 (2022-01-09)
77
+ * (foxriver76) added `info.connection` state (closes #268)
78
+
76
79
  ### 3.6.1 (2022-01-09)
77
80
  * (foxriver76) ct values of groups can be even lower due to third party lights
78
81
 
package/io-package.json CHANGED
@@ -1,9 +1,33 @@
1
1
  {
2
2
  "common": {
3
3
  "name": "hue",
4
- "version": "3.6.1",
4
+ "version": "3.6.3",
5
5
  "tier": 2,
6
6
  "news": {
7
+ "3.6.3": {
8
+ "en": "added `info.connection` state (closes #268)",
9
+ "de": "Status `info.connection` hinzugefügt (schließt #268)",
10
+ "ru": "добавлено состояние `info.connection` (закрывает # 268)",
11
+ "pt": "adicionado estado `info.connection` (fecha # 268)",
12
+ "nl": "status 'info.connection' toegevoegd (sluit #268 af)",
13
+ "fr": "ajout de l'état `info.connection` (ferme #268)",
14
+ "it": "aggiunto stato `info.connection` (chiude #268)",
15
+ "es": "agregado estado `info.connection` (cierra # 268)",
16
+ "pl": "dodany stan `info.connection` (zamyka #268)",
17
+ "zh-cn": "添加了 `info.connection` 状态(关闭 #268)"
18
+ },
19
+ "3.6.2": {
20
+ "en": "added `info.connection` state (closes #268)",
21
+ "de": "Status `info.connection` hinzugefügt (schließt #268)",
22
+ "ru": "добавлено состояние `info.connection` (закрывает # 268)",
23
+ "pt": "adicionado estado `info.connection` (fecha # 268)",
24
+ "nl": "status 'info.connection' toegevoegd (sluit #268 af)",
25
+ "fr": "ajout de l'état `info.connection` (ferme #268)",
26
+ "it": "aggiunto stato `info.connection` (chiude #268)",
27
+ "es": "agregado estado `info.connection` (cierra # 268)",
28
+ "pl": "dodany stan `info.connection` (zamyka #268)",
29
+ "zh-cn": "添加了 `info.connection` 状态(关闭 #268)"
30
+ },
7
31
  "3.6.1": {
8
32
  "en": "ct values of groups can be even lower due to third party lights",
9
33
  "de": "ct-Werte von Gruppen können durch Fremdlichter noch niedriger sein",
@@ -63,30 +87,6 @@
63
87
  "es": "Error de SENTRY detectado.",
64
88
  "pl": "Wykryto błąd SENTRY.",
65
89
  "zh-cn": "发现哨兵错误。"
66
- },
67
- "3.5.28": {
68
- "en": "another fix for ivnalid ct values (fixes #234)",
69
- "de": "ein weiterer Fix für ivnalid ct-Werte (Fixes #234)",
70
- "ru": "еще одно исправление для значений ct ivnalid (исправления # 234)",
71
- "pt": "outra correção para valores ivnalid ct (correções # 234)",
72
- "nl": "een andere oplossing voor ivnalid ct-waarden (fixes #234)",
73
- "fr": "un autre correctif pour les valeurs ivnalid ct (corrections #234)",
74
- "it": "un'altra correzione per i valori ct ivnalid (correzioni #234)",
75
- "es": "otra corrección para los valores de ivnalid ct (correcciones # 234)",
76
- "pl": "kolejna poprawka dla wartości ivnalid ct (poprawki #234)",
77
- "zh-cn": "ivnalid ct 值的另一个修复(修复 #234)"
78
- },
79
- "3.5.27": {
80
- "en": "we fixed missing object type of some scenes (closes #255)",
81
- "de": "wir haben den fehlenden Objekttyp einiger Szenen behoben (schließt #255)",
82
- "ru": "мы исправили отсутствующий тип объекта в некоторых сценах (закрывает # 255)",
83
- "pt": "corrigimos o tipo de objeto ausente em algumas cenas (fecha # 255)",
84
- "nl": "we hebben het ontbrekende objecttype van sommige scènes gerepareerd (sluit # 255)",
85
- "fr": "nous avons corrigé le type d'objet manquant de certaines scènes (ferme #255)",
86
- "it": "abbiamo corretto il tipo di oggetto mancante di alcune scene (chiude #255)",
87
- "es": "arreglamos el tipo de objeto faltante de algunas escenas (cierra # 255)",
88
- "pl": "naprawiliśmy brakujący typ obiektu w niektórych scenach (zamyka #255)",
89
- "zh-cn": "我们修复了某些场景中缺少的对象类型(关闭 #255)"
90
90
  }
91
91
  },
92
92
  "titleLang": {
@@ -182,5 +182,28 @@
182
182
  "type": "enum",
183
183
  "native": {}
184
184
  }
185
+ ],
186
+ "instanceObjects": [
187
+ {
188
+ "_id": "info",
189
+ "type": "channel",
190
+ "common": {
191
+ "name": "Information"
192
+ },
193
+ "native": {}
194
+ },
195
+ {
196
+ "_id": "info.connection",
197
+ "type": "state",
198
+ "common": {
199
+ "role": "indicator.connected",
200
+ "name": "If connected to Hue Bridge",
201
+ "type": "boolean",
202
+ "read": true,
203
+ "write": false,
204
+ "def": false
205
+ },
206
+ "native": {}
207
+ }
185
208
  ]
186
209
  }
package/main.js CHANGED
@@ -631,7 +631,7 @@ function startAdapter(options) {
631
631
  }
632
632
  },
633
633
  ready: main,
634
- unload: callback => {
634
+ unload: async callback => {
635
635
  try {
636
636
  if (pollingInterval) {
637
637
  clearTimeout(pollingInterval);
@@ -642,6 +642,9 @@ function startAdapter(options) {
642
642
  clearTimeout(reconnectTimeout);
643
643
  reconnectTimeout = null;
644
644
  }
645
+
646
+ await adapter.setStateAsync('info.connection', false, true);
647
+
645
648
  adapter.log.info('cleaned everything up...');
646
649
  callback();
647
650
  } catch {
@@ -900,18 +903,13 @@ async function connect() {
900
903
  } // endElse
901
904
  config = await api.configuration.getAll();
902
905
  } catch (e) {
903
- adapter.log.warn(`Could not connect to HUE bridge (${adapter.config.bridge}:${adapter.config.port})`);
904
906
  adapter.log.error(e.message || e);
905
- await new Promise(resolve => {
906
- reconnectTimeout = setTimeout(connect, 5000, resolve);
907
- });
908
907
  } // endCatch
909
908
 
910
909
  if (!config || !config.config) {
911
910
  adapter.log.warn(`Could not get configuration from HUE bridge (${adapter.config.bridge}:${adapter.config.port})`);
912
- await new Promise(resolve => {
913
- reconnectTimeout = setTimeout(connect, 5000, resolve);
914
- });
911
+ setTimeout(connect, 5000);
912
+ return;
915
913
  } // endIf
916
914
 
917
915
  // even if useLegacyStructure is false, we check if the structure exists to not create chaos
@@ -932,6 +930,8 @@ async function connect() {
932
930
  const lightsArr = lights ? Object.keys(lights) : [];
933
931
  const objs = [];
934
932
 
933
+ await adapter.setStateAsync('info.connection', true, true);
934
+
935
935
  noDevices = sensorsArr.length + lightsArr.length;
936
936
 
937
937
  for (const sid of sensorsArr) {
@@ -1726,6 +1726,7 @@ async function poll() {
1726
1726
 
1727
1727
  try {
1728
1728
  const config = await api.configuration.getAll();
1729
+ await adapter.setStateChangedAsync('info.connection', true, true);
1729
1730
 
1730
1731
  if (adapter.log.level === 'debug' || adapter.log.level === 'silly') {
1731
1732
  adapter.log.debug(`Polled config: ${JSON.stringify(config)}`);
@@ -1979,6 +1980,7 @@ async function poll() {
1979
1980
  }
1980
1981
  } // endIf
1981
1982
  } catch (e) {
1983
+ await adapter.setStateChangedAsync('info.connection', false, true);
1982
1984
  adapter.log.error(`Could not poll all: ${e.message || e}`);
1983
1985
  }
1984
1986
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "iobroker.hue",
3
- "version": "3.6.1",
3
+ "version": "3.6.3",
4
4
  "description": "Connects Philips Hue LED Bulbs, Friends of Hue LED Lamps and Stripes and other SmartLink capable Devices (LivingWhites, some LivingColors) via Philips Hue Bridges",
5
5
  "author": "hobbyquaker <hq@ccu.io>",
6
6
  "contributors": [