Skip to content

Commit

Permalink
chore: release v3.5.5
Browse files Browse the repository at this point in the history
fixed a bug where an error on user creation crashed the adapter instance
  • Loading branch information
foxriver76 committed Apr 7, 2021
1 parent 448deac commit 184fab3
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 35 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ In den Adapter-Settings muss die IP der Hue Bridge sowie ein Username konfigurie
### __WORK IN PROGRESS__
-->

### 3.5.5 (2021-04-07)
* (foxriver76) fixed a bug where an error on user creation crashed the adapter instance

### 3.5.4 (2021-03-25)
* (foxriver76) fixing several edge case crashes

Expand Down
26 changes: 13 additions & 13 deletions io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
{
"common": {
"name": "hue",
"version": "3.5.4",
"version": "3.5.5",
"news": {
"3.5.5": {
"en": "fixed a bug where an error on user creation crashed the adapter instance",
"de": "Es wurde ein Fehler behoben, durch den ein Fehler bei der Benutzererstellung die Adapterinstanz zum Absturz brachte",
"ru": "исправлена ошибка, из-за которой ошибка при создании пользователя приводила к сбою экземпляра адаптера",
"pt": "corrigiu um bug em que um erro na criação do usuário travava a instância do adaptador",
"nl": "een bug verholpen waarbij een fout bij het maken van de gebruiker de adapterinstantie crashte",
"fr": "correction d'un bug où une erreur lors de la création de l'utilisateur bloquait l'instance d'adaptateur",
"it": "risolto un bug in cui un errore nella creazione dell'utente causava il crash dell'istanza dell'adattatore",
"es": "Se corrigió un error en el que un error en la creación del usuario bloqueaba la instancia del adaptador.",
"pl": "naprawiono błąd polegający na tym, że błąd podczas tworzenia użytkownika powodował awarię instancji adaptera",
"zh-cn": "修复了用户创建错误使适配器实例崩溃的错误"
},
"3.5.4": {
"en": "fixing several edge case crashes",
"de": "Beheben mehrerer Abstürze des Randgehäuses",
Expand Down Expand Up @@ -230,18 +242,6 @@
"es": "ya no requiere reiniciar cuando se elimina el dispositivo, eliminar automáticamente si se admite la función de eliminación recursiva",
"pl": "nie wymaga już restartu po usunięciu urządzenia, automatyczne usuwanie, jeśli obsługiwana jest funkcja usuwania rekurencyjnego",
"zh-cn": "删除设备后不再需要重新启动,如果支持递归删除功能,则自动删除"
},
"3.1.1": {
"en": "added additional frontend validation of polling interval and improved error handling",
"de": "Zusätzliche Frontend-Validierung des Abfrageintervalls und verbesserte Fehlerbehandlung hinzugefügt",
"ru": "добавлена дополнительная проверка внешнего интерфейса интервала опроса и улучшена обработка ошибок",
"pt": "adição adicional de validação front-end do intervalo de pesquisa e melhor tratamento de erros",
"nl": "extra frontend-validatie van polling-interval en verbeterde foutafhandeling toegevoegd",
"fr": "ajouté une validation frontale supplémentaire de l'intervalle d'interrogation et une meilleure gestion des erreurs",
"it": "aggiunta ulteriore validazione frontend dell'intervallo di polling e migliorata gestione degli errori",
"es": "Se agregó validación frontend adicional del intervalo de sondeo y mejor manejo de errores",
"pl": "dodano dodatkową weryfikację interfejsu interwału sondowania i ulepszoną obsługę błędów",
"zh-cn": "添加了额外的轮询间隔前端验证并改进了错误处理"
}
},
"titleLang": {
Expand Down
20 changes: 14 additions & 6 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
/* jslint node: true */
'use strict';

const { v3 } = require('node-hue-api');
const {v3} = require('node-hue-api');
const utils = require('@iobroker/adapter-core');
const hueHelper = require('./lib/hueHelper');
const tools = require('./lib/tools');
Expand All @@ -24,12 +24,14 @@ let adapter;
let pollingInterval;
let reconnectTimeout;

const supportedSensors = ['ZLLSwitch',
const supportedSensors = [
'ZLLSwitch',
'ZGPSwitch',
'Daylight',
'ZLLTemperature',
'ZLLPresence',
'ZLLLightLevel'];
'ZLLLightLevel'
];

function startAdapter(options) {
options = options || {};
Expand Down Expand Up @@ -556,7 +558,8 @@ function startAdapter(options) {
lightState.on(finalLS.on);
try {
await api.lights.setLightState(channelIds[id], lightState);
await updateLightState({id: channelIds[id],
await updateLightState({
id: channelIds[id],
name: obj._id.substr(adapter.namespace.length + 1)
});
adapter.log.debug(`updated lighstate(${channelIds[id]}) after change`);
Expand Down Expand Up @@ -692,9 +695,14 @@ async function createUser(ip) {
} catch (e) {
// 101 is bridge button not pressed
if (!e.getHueErrorType || e.getHueErrorType() !== 101) {
adapter.log.error(e);
adapter.log.error(e.message);
}
return {error: e.getHueErrorType ? e.getHueErrorType() : e, message: e.message};
// we see error as an error code only to detect 101, we do not use whole e here,
// because it seems to be a circular structure sometimes
return {
error: e.getHueErrorType ? e.getHueErrorType() : -1,
message: e.getHueErrorMessage ? e.getHueErrorMessage() : e.message
};
}
} // endCreateUser

Expand Down
110 changes: 96 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.hue",
"version": "3.5.4",
"version": "3.5.5",
"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 <[email protected]>",
"contributors": [
Expand Down Expand Up @@ -35,7 +35,7 @@
"@alcalzone/release-script": "^1.8.3",
"@iobroker/testing": "^2.4.4",
"chai": "^4.3.4",
"eslint": "^7.22.0",
"eslint": "^7.23.0",
"gulp": "^4.0.2",
"mocha": "^8.3.2"
},
Expand Down

0 comments on commit 184fab3

Please sign in to comment.