From 6aa590d37e368360b83336c59888a8c5fbf20816 Mon Sep 17 00:00:00 2001 From: Moritz Heusinger Date: Wed, 5 May 2021 11:45:41 +0200 Subject: [PATCH] chore: release v3.5.15 fixed some default type values, which produced warnings once --- README.md | 3 +++ io-package.json | 26 +++++++++++++------------- main.js | 15 ++++++++------- package-lock.json | 4 ++-- package.json | 2 +- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 73f09f95..784da2d1 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,9 @@ In den Adapter-Settings muss die IP der Hue Bridge sowie ein Username konfigurie ### __WORK IN PROGRESS__ --> +### 3.5.15 (2021-05-05) +* (foxriver76) fixed some default type values, which produced warnings once + ### 3.5.14 (2021-05-04) * (foxriver76) protect the user token from access by foreign adapters * (foxriver76) fixed types of default values on groups diff --git a/io-package.json b/io-package.json index 8b7dde09..24e99141 100644 --- a/io-package.json +++ b/io-package.json @@ -1,9 +1,21 @@ { "common": { "name": "hue", - "version": "3.5.14", + "version": "3.5.15", "tier": 2, "news": { + "3.5.15": { + "en": "fixed some default type values, which produced warnings once", + "de": "Einige Standardtypwerte wurden behoben, die einmal zu Warnungen führten", + "ru": "исправлены некоторые значения типов по умолчанию, которые один раз выдавали предупреждения", + "pt": "corrigiu alguns valores de tipo padrão, que produziram avisos uma vez", + "nl": "enkele standaard typewaarden gerepareerd, die eenmaal waarschuwingen produceerden", + "fr": "correction de certaines valeurs de type par défaut, qui produisaient des avertissements une fois", + "it": "risolti alcuni valori di tipo predefinito, che producevano avvisi una volta", + "es": "se corrigieron algunos valores de tipo predeterminados, que producían advertencias una vez", + "pl": "naprawiono niektóre domyślne wartości typu, które raz generowały ostrzeżenia", + "zh-cn": "修复了一些默认类型值,该默认值一旦产生警告" + }, "3.5.14": { "en": "protect the user token from access by foreign adapters\nfixed types of default values on groups", "de": "Schützen Sie das Benutzertoken vor dem Zugriff durch fremde Adapter\nFeste Arten von Standardwerten für Gruppen", @@ -231,18 +243,6 @@ "es": "ahora manejamos posibles conflictos de identificación, cuando el usuario agrega nuevos dispositivos de diferentes tipos con el mismo nombre a lo largo del tiempo", "pl": "teraz radzimy sobie z potencjalnymi konfliktami identyfikatorów, gdy użytkownik dodaje z czasem nowe urządzenia innego typu o tej samej nazwie", "zh-cn": "现在,当用户随着时间的推移添加具有相同名称的不同类型的新设备时,我们现在可以处理潜在的ID冲突" - }, - "3.3.2": { - "en": "internal optimizations - polling after change timeout removed, was 150 ms, now we poll instantly", - "de": "Interne Optimierungen - Abfrage nach entferntem Zeitlimit für Änderungen betrug 150 ms, jetzt werden sofort abgefragt", - "ru": "внутренняя оптимизация - опрос после изменения времени ожидания удален, прошло 150 мс, теперь мы проводим опрос мгновенно", - "pt": "otimizações internas - a pesquisa após o tempo limite da alteração foi removida foi de 150 ms, agora pesquisamos", - "nl": "interne optimalisaties - polling nadat de time-out voor de wijziging was verwijderd, was 150 ms, nu peilen we onmiddellijk", - "fr": "optimisations internes - interrogation après expiration du délai de modification, était de 150 ms, nous interrogeons instantanément", - "it": "ottimizzazioni interne: il polling dopo la modifica del timeout rimosso era di 150 ms, ora eseguiamo immediatamente il polling", - "es": "optimizaciones internas: el sondeo después de que se eliminó el tiempo de espera de cambio, era de 150 ms, ahora sondeamos al instante", - "pl": "wewnętrzne optymalizacje - odpytywanie po usunięciu limitu czasu zmiany wynosiło 150 ms, teraz sondujemy natychmiast", - "zh-cn": "内部优化-更改超时删除后的轮询为150毫秒,现在我们立即进行轮询" } }, "titleLang": { diff --git a/main.js b/main.js index d4a682ea..7cee0d3b 100644 --- a/main.js +++ b/main.js @@ -989,7 +989,7 @@ async function connect() { lobj.common.write = false; break; case 'pending': - lobj.common.type = 'number'; + lobj.common.type = 'array'; lobj.common.role = 'config'; lobj.common.write = false; break; @@ -1022,7 +1022,7 @@ async function connect() { break; } - lobj.common.def = value; + lobj.common.def = value && typeof value === 'object' ? JSON.stringify(value) : value; objs.push(lobj); } @@ -1208,7 +1208,7 @@ async function connect() { lobj.common.role = 'command'; break; case 'pending': - lobj.common.type = 'number'; + lobj.common.type = 'array'; lobj.common.role = 'config'; break; case 'mode': @@ -1220,7 +1220,7 @@ async function connect() { break; } - lobj.common.def = typeof value === 'object' ? JSON.stringify(value) : value; + lobj.common.def = value && typeof value === 'object' ? JSON.stringify(value) : value; objs.push(lobj); } @@ -1262,7 +1262,7 @@ async function connect() { alert: 'select', bri: 0, colormode: '', - ct: 2179, // min value, else it gets inf + ct: 1e6 / 2179, // min value, else it gets inf effect: 'none', hue: 0, on: false, @@ -1414,7 +1414,7 @@ async function connect() { adapter.log.info(`skip group: ${gobjId}`); continue; } - gobj.common.def = typeof group.action[action] === 'object' ? JSON.stringify(group.action[action]): group.action[action]; + gobj.common.def = group.action[action] && typeof group.action[action] === 'object' ? JSON.stringify(group.action[action]): group.action[action]; objs.push(gobj); } // endFor @@ -1471,6 +1471,7 @@ async function connect() { type: 'state', common: { name: `${groupName}.activeStream`, + type: 'boolean', role: 'indicator', read: true, write: true, @@ -1640,7 +1641,7 @@ async function syncStates(states) { const nameId = task.id.split('.')[adapter.config.useLegacyStructure ? 3 : 2]; if (blockedIds[nameId] !== true) { try { - await adapter.setForeignStateChangedAsync(task.id.replace(/\s/g, '_'), typeof task.val === 'object' ? JSON.stringify(task.val) : task.val, true); + await adapter.setForeignStateChangedAsync(task.id.replace(/\s/g, '_'), task.val && typeof task.val === 'object' ? JSON.stringify(task.val) : task.val, true); } catch (e) { adapter.log.warn(`Error on syncing state of ${task.id.replace(/\\s/g, '_')}: ${e}`); } diff --git a/package-lock.json b/package-lock.json index 7eee59f6..ce3dee49 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "iobroker.hue", - "version": "3.5.14", + "version": "3.5.15", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "iobroker.hue", - "version": "3.5.14", + "version": "3.5.15", "license": "Apache-2.0", "dependencies": { "@iobroker/adapter-core": "^2.4.0", diff --git a/package.json b/package.json index cb0b0aa6..5e0618c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.hue", - "version": "3.5.14", + "version": "3.5.15", "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": [