Skip to content

Commit

Permalink
1.7.3
Browse files Browse the repository at this point in the history
Dynamic modes for alarm control panel.
  • Loading branch information
RonnyWinkler committed Nov 2, 2024
1 parent bfb1bd0 commit 8ed9d2a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions .homeychangelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,10 @@
"1.7.2": {
"en": "Dynamic modes for alarm control panel.",
"de": "Dynamische Modi für Alarmzentrale."
},
"1.7.3": {
"en": "Dynamic modes for alarm control panel.",
"de": "Dynamische Modi für Alarmzentrale."
}

}
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.7.2",
"version": "1.7.3",
"compatibility": ">=12.0.1",
"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.7.2",
"version": "1.7.3",
"compatibility": ">=12.0.1",
"sdk": 3,
"brandColor": "#0DA6EA",
Expand Down
8 changes: 6 additions & 2 deletions drivers/alarm_control_panel/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const BaseDevice = require('../basedevice');
class AlarmControlPanelDevice extends BaseDevice {

async onInit() {
await super.onInit();
this.features = this.getStoreValue('features') || undefined;

this.features = undefined;
await super.onInit();

// Capability listener for device capabilities
this.registerCapabilityListener('alarm_control_panel_mode', async (value, opts) => {
Expand Down Expand Up @@ -69,6 +69,7 @@ class AlarmControlPanelDevice extends BaseDevice {

if (features != undefined && this.features != features){
this.features = features;
await this.setStoreValue('features', features);
try{
let modes = [];
if ((features & 1) == 1) {
Expand All @@ -91,6 +92,9 @@ class AlarmControlPanelDevice extends BaseDevice {
if ((features & 8) != 8 && this.hasCapability('alarm_control_panel_alarm_trigger')){
this.removeCapability('alarm_control_panel_alarm_trigger');
}
if ((features & 8) == 8 && !this.hasCapability('alarm_control_panel_alarm_trigger')){
this.addCapability('alarm_control_panel_alarm_trigger');
}
}
catch(error){
this.log("AlarmPanel onInitDevice() Error updating features: "+error.message);
Expand Down

0 comments on commit 8ed9d2a

Please sign in to comment.