From 20c46dbfe379b71434f6df36bf4dace1c351ae62 Mon Sep 17 00:00:00 2001 From: Moritz Heusinger Date: Wed, 2 Jun 2021 14:41:10 +0200 Subject: [PATCH] chore: release v3.5.19 fix crash case if we cannot get min/max ct values --- README.md | 2 ++ io-package.json | 26 +++++++++++++------------- main.js | 11 ++++++++--- package-lock.json | 2 +- package.json | 2 +- 5 files changed, 25 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 1d6e13da..157114eb 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,8 @@ In den Adapter-Settings muss die IP der Hue Bridge sowie ein Username konfigurie Placeholder for the next version (at the beginning of the line): ### __WORK IN PROGRESS__ --> +### 3.5.19 (2021-06-02) +* (foxriver76) fix crash case if we cannot get min/max ct values ### 3.5.18 (2021-06-01) * (foxriver76) get the correct min/max ct values from api for lights (closes #192) diff --git a/io-package.json b/io-package.json index 653cb1f9..c02faa8b 100644 --- a/io-package.json +++ b/io-package.json @@ -1,9 +1,21 @@ { "common": { "name": "hue", - "version": "3.5.18", + "version": "3.5.19", "tier": 2, "news": { + "3.5.19": { + "en": "fix crash case if we cannot get min/max ct values", + "de": "Crash-Fall beheben, wenn wir keine Min/Max-CT-Werte erhalten können", + "ru": "исправить случай сбоя, если мы не можем получить минимальные / максимальные значения ct", + "pt": "consertar o caso de falha se não conseguirmos obter os valores min / max ct", + "nl": "crashgeval repareren als we geen min/max ct-waarden kunnen krijgen", + "fr": "corriger le cas de plantage si nous ne pouvons pas obtenir les valeurs min/max ct", + "it": "risolvere il caso di arresto anomalo se non riusciamo a ottenere i valori ct min/max", + "es": "arreglar caso de falla si no podemos obtener valores mínimos / máximos de ct", + "pl": "napraw przypadek awarii, jeśli nie możemy uzyskać wartości min/max ct", + "zh-cn": "如果我们无法获得最小/最大 ct 值,则修复崩溃案例" + }, "3.5.18": { "en": "get the correct min/max ct values from api for lights (closes #192)", "de": "Holen Sie sich die richtigen Min / Max-Ct-Werte von der API für Lichter (schließt # 192)", @@ -231,18 +243,6 @@ "es": "ya no establecemos estados de estados no existentes", "pl": "nie stawiamy już stanów nieistniejących stanów", "zh-cn": "我们不再设置不存在状态的状态" - }, - "3.3.8": { - "en": "marked read-only states accordingly", - "de": "schreibgeschützte Zustände entsprechend markiert", - "ru": "отмечены состояния только для чтения соответственно", - "pt": "marcado como somente leitura de acordo", - "nl": "gemarkeerd als alleen-lezen staten dienovereenkomstig", - "fr": "États en lecture seule marqués en conséquence", - "it": "contrassegnato di conseguenza gli stati di sola lettura", - "es": "marcados estados de solo lectura en consecuencia", - "pl": "oznaczone odpowiednio jako tylko do odczytu", - "zh-cn": "标记为只读状态" } }, "titleLang": { diff --git a/main.js b/main.js index 76abc07d..a9caba9f 100644 --- a/main.js +++ b/main.js @@ -1160,9 +1160,14 @@ async function connect() { lobj.common.role = 'level.color.xy'; break; case 'ct': { - const light = await api.lights.getLight(parseInt(lid)); - // often max: 454 or 500, min: 153 - const ctObj = light._populationData.capabilities.control.ct; + let ctObj = {min: 153, max: 500}; // fallback object + try { + const light = await api.lights.getLight(parseInt(lid)); + // often max: 454 or 500, min: 153 + ctObj = light._populationData.capabilities.control.ct; + } catch { + // ignore + } lobj.common.type = 'number'; lobj.common.role = 'level.color.temperature'; lobj.common.unit = '°K'; diff --git a/package-lock.json b/package-lock.json index bef997fd..2d744686 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "iobroker.hue", - "version": "3.5.18", + "version": "3.5.19", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 30b25365..64c477db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.hue", - "version": "3.5.18", + "version": "3.5.19", "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", "author": "hobbyquaker ", "contributors": [