diff --git a/README.md b/README.md index 469ce3e..819d246 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,9 @@ If any error occurs, please set the adapter loglevel to debug and send me the da If this project helped you to reduce developing time, you can give me a cup of coffee or a bottle of beer via PayPal(chvorholt@gmail.com) :-) ## Changelog +#### 2.1.3 (27-Jun-2019) +- compatibility for boolean values and old Wiffi versions + #### 2.1.2 (21-Jun-2019) - changed behaviour: if states are missing in the datagram, but present in the database, they are not removed from the database - boolean and numeric values are correctly stored diff --git a/io-package.json b/io-package.json index cb85c15..26fac10 100644 --- a/io-package.json +++ b/io-package.json @@ -1,8 +1,20 @@ { "common": { "name": "wiffi-wz", - "version": "2.1.2", + "version": "2.1.3", "news": { + "2.1.3": { + "en": "compatibility for boolean values and old Wiffi versions", + "de": "Kompatibilität für Boolesche Werte und alte Wiffi-Versionen", + "ru": "совместимость для логических значений и старых версий Wiffi", + "pt": "compatibilidade para valores booleanos e versões antigas do Wiffi", + "nl": "compatibiliteit voor booleaanse waarden en oude Wiffi-versies", + "fr": "Compatibilité pour les valeurs booléennes et les anciennes versions de Wiffi", + "it": "compatibilità per valori booleani e vecchie versioni di Wiffi", + "es": "Compatibilidad con valores booleanos y versiones anteriores de Wiffi.", + "pl": "zgodność dla wartości logicznych i starych wersji Wiffi", + "zh-cn": "兼容布尔值和旧Wiffi版本" + }, "2.1.2": { "en": "boolean values are correctly saved", "de": "Boolesche Werte werden korrekt gespeichert", diff --git a/main.js b/main.js index 6f14deb..aa0682e 100644 --- a/main.js +++ b/main.js @@ -622,7 +622,11 @@ function cast_wiffi_value(wiffi_val, wiffi_type) { let val; switch (wiffi_type) { case 'boolean': - val = ((wiffi_val === 'true') ? true : false); + if(typeof wiffi_val === 'boolean') { + val = wiffi_val; + } else { + val = (wiffi_val === 'true'); + } break; case 'number': val = Number(wiffi_val); diff --git a/package.json b/package.json index 1755447..be884db 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iobroker.wiffi-wz", - "version": "2.1.2", + "version": "2.1.3", "description": "Wiffi-wz Adapter", "author": { "name": "Christian Vorholt",