mirror of
https://github.com/esphome/esphome.git
synced 2025-01-08 13:51:43 +01:00
Add files via upload
This commit is contained in:
parent
1829e68730
commit
a0777b41e1
3 changed files with 33 additions and 27 deletions
|
@ -58,6 +58,7 @@ ALARM_SENSOR_TYPES = {
|
|||
"DELAYED": AlarmSensorType.ALARM_SENSOR_TYPE_DELAYED,
|
||||
"INSTANT": AlarmSensorType.ALARM_SENSOR_TYPE_INSTANT,
|
||||
"DELAYED_FOLLOWER": AlarmSensorType.ALARM_SENSOR_TYPE_DELAYED_FOLLOWER,
|
||||
"INSTANT_ALWAYS": AlarmSensorType.ALARM_SENSOR_TYPE_INSTANT_ALWAYS,
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -58,6 +58,9 @@ void TemplateAlarmControlPanel::dump_config() {
|
|||
case ALARM_SENSOR_TYPE_DELAYED_FOLLOWER:
|
||||
sensor_type = "delayed_follower";
|
||||
break;
|
||||
case ALARM_SENSOR_TYPE_INSTANT_ALWAYS:
|
||||
sensor_type = "instant_always";
|
||||
break;
|
||||
case ALARM_SENSOR_TYPE_DELAYED:
|
||||
default:
|
||||
sensor_type = "delayed";
|
||||
|
@ -145,24 +148,25 @@ void TemplateAlarmControlPanel::loop() {
|
|||
continue;
|
||||
}
|
||||
|
||||
// If sensor type is of type instant
|
||||
if (sensor_info.second.type == ALARM_SENSOR_TYPE_INSTANT) {
|
||||
switch(sensor_info.second.type) {
|
||||
case ALARM_SENSOR_TYPE_INSTANT:
|
||||
instant_sensor_not_ready = true;
|
||||
break;
|
||||
}
|
||||
// If sensor type is of type interior follower
|
||||
if (sensor_info.second.type == ALARM_SENSOR_TYPE_DELAYED_FOLLOWER) {
|
||||
case ALARM_SENSOR_TYPE_INSTANT_ALWAYS:
|
||||
instant_sensor_not_ready = true;
|
||||
future_state = ACP_STATE_TRIGGERED;
|
||||
break;
|
||||
case ALARM_SENSOR_TYPE_DELAYED_FOLLOWER:
|
||||
// Look to see if we are in the pending state
|
||||
if (this->current_state_ == ACP_STATE_PENDING) {
|
||||
delayed_sensor_not_ready = true;
|
||||
} else {
|
||||
instant_sensor_not_ready = true;
|
||||
}
|
||||
}
|
||||
// If sensor type is of type delayed
|
||||
if (sensor_info.second.type == ALARM_SENSOR_TYPE_DELAYED) {
|
||||
delayed_sensor_not_ready = true;
|
||||
break;
|
||||
case ALARM_SENSOR_TYPE_DELAYED:
|
||||
default:
|
||||
delayed_sensor_not_ready = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,7 +27,8 @@ enum BinarySensorFlags : uint16_t {
|
|||
enum AlarmSensorType : uint16_t {
|
||||
ALARM_SENSOR_TYPE_DELAYED = 0,
|
||||
ALARM_SENSOR_TYPE_INSTANT,
|
||||
ALARM_SENSOR_TYPE_DELAYED_FOLLOWER
|
||||
ALARM_SENSOR_TYPE_DELAYED_FOLLOWER,
|
||||
ALARM_SENSOR_TYPE_INSTANT_ALWAYS,
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue