From b34158cc5370a4123a30b7605163b051ec1e7fde Mon Sep 17 00:00:00 2001 From: RonnyWinkler Date: Thu, 18 Jan 2024 18:51:00 +0100 Subject: [PATCH] 1.5.12 Fixed value update for onoff capabilities added in custom devices. --- .homeychangelog.json | 4 ++++ .homeycompose/app.json | 2 +- app.json | 2 +- drivers/basedevice.js | 4 +++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.homeychangelog.json b/.homeychangelog.json index edd1808..5468358 100644 --- a/.homeychangelog.json +++ b/.homeychangelog.json @@ -530,6 +530,10 @@ "1.5.11": { "en": "Fixed 'Value of capability changed' flow card for compound devices.", "de": "'Wert des Attributes geändert' Flow-Karte korrigiert für Compound-Geräte" + }, + "1.5.12": { + "en": "Fixed value update for onoff capabilities added in custom devices.", + "de": "Wertübernahme korrigiert für onoff Capabilities in benutzerdefinierten Geräten." } } diff --git a/.homeycompose/app.json b/.homeycompose/app.json index 07f1be2..df01e9c 100644 --- a/.homeycompose/app.json +++ b/.homeycompose/app.json @@ -1,6 +1,6 @@ { "id": "io.home-assistant.community", - "version": "1.5.11", + "version": "1.5.12", "compatibility": ">=8.1.0", "sdk": 3, "brandColor": "#0DA6EA", diff --git a/app.json b/app.json index b87956e..35ecd03 100644 --- a/app.json +++ b/app.json @@ -1,7 +1,7 @@ { "_comment": "This file is generated. Please edit .homeycompose/app.json instead.", "id": "io.home-assistant.community", - "version": "1.5.11", + "version": "1.5.12", "compatibility": ">=8.1.0", "sdk": 3, "brandColor": "#0DA6EA", diff --git a/drivers/basedevice.js b/drivers/basedevice.js index fb96b50..7f4124a 100644 --- a/drivers/basedevice.js +++ b/drivers/basedevice.js @@ -30,6 +30,8 @@ const defaultBooleanConverter = { return true; case "off": return false; + default: + return null; } // state == "on" }, @@ -504,7 +506,7 @@ class BaseDevice extends Homey.Device { tokens.value_number = newValue; await this.setCapabilityValue(keys[i], newValue); } - else if (keys[i].startsWith("switch") || keys[i].startsWith("input_boolean") || keys[i].startsWith("onoff_button") || keys[i].startsWith("onoff_state") ){ + else if (keys[i].startsWith("onoff") || keys[i].startsWith("onoff_button") || keys[i].startsWith("onoff_state") ){ // boolean capability if (converter != undefined){ newValue = converter(entityValue);