Open LewisSpring opened 1 year ago
bool AlarmControlPanel::is_state_armed(AlarmControlPanelState state) {
switch (state) {
case ACP_STATE_ARMED_AWAY:
case ACP_STATE_ARMED_HOME:
case ACP_STATE_ARMED_NIGHT:
case ACP_STATE_ARMED_VACATION:
case ACP_STATE_ARMED_CUSTOM_BYPASS:
return true;
default:
return false;
}
};
So it doesn't work for disarmed state. Something like that would indicate disarmed state:
bool AlarmControlPanel::is_state_disarmed(AlarmControlPanelState state) {
if (state == ACP_STATE_DISARMED ) {
return true;
}
else {
return false;
}
};
But better way would be to read and compare all states of alarm in variable..
@grahambrown115
Describe the problem you have/What new integration you would like Add armed_away, armed_home, disarmed, pending triggers. (any trigger that is missing for possible states)
Please describe your use case for this integration and alternatives you've tried:
This would allow users to turn on LEDS to indicate states, send HTTP requests per state, sound a buzzer to indicate progress of setting (ARMING --> ARM_*)
Above example works fine, but a NOT version for detecting disarmed state does not.
Additional context