Skip to content

Commit

Permalink
1.5.12
Browse files Browse the repository at this point in the history
Fixed value update for onoff capabilities added in custom devices.
  • Loading branch information
RonnyWinkler committed Jan 18, 2024
1 parent 6997741 commit b34158c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions .homeychangelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -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."
}

}
2 changes: 1 addition & 1 deletion .homeycompose/app.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion app.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 3 additions & 1 deletion drivers/basedevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ const defaultBooleanConverter = {
return true;
case "off":
return false;
default:
return null;
}
// state == "on"
},
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit b34158c

Please sign in to comment.