mirror of
https://github.com/esphome/esphome.git
synced 2026-02-08 00:31:58 +00:00
[template.alarm_control_panel] Fix compile without binary_sensor (#12548)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -39,6 +39,7 @@ enum TemplateAlarmControlPanelRestoreMode {
|
|||||||
ALARM_CONTROL_PANEL_RESTORE_DEFAULT_DISARMED,
|
ALARM_CONTROL_PANEL_RESTORE_DEFAULT_DISARMED,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef USE_BINARY_SENSOR
|
||||||
struct SensorDataStore {
|
struct SensorDataStore {
|
||||||
bool last_chime_state;
|
bool last_chime_state;
|
||||||
};
|
};
|
||||||
@@ -49,7 +50,6 @@ struct SensorInfo {
|
|||||||
uint8_t store_index;
|
uint8_t store_index;
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef USE_BINARY_SENSOR
|
|
||||||
struct AlarmSensor {
|
struct AlarmSensor {
|
||||||
binary_sensor::BinarySensor *sensor;
|
binary_sensor::BinarySensor *sensor;
|
||||||
SensorInfo info;
|
SensorInfo info;
|
||||||
@@ -139,6 +139,9 @@ class TemplateAlarmControlPanel final : public alarm_control_panel::AlarmControl
|
|||||||
FixedVector<AlarmSensor> sensors_;
|
FixedVector<AlarmSensor> sensors_;
|
||||||
// a list of automatically bypassed sensors
|
// a list of automatically bypassed sensors
|
||||||
std::vector<uint8_t> bypassed_sensor_indicies_;
|
std::vector<uint8_t> bypassed_sensor_indicies_;
|
||||||
|
// Per sensor data store
|
||||||
|
std::vector<SensorDataStore> sensor_data_;
|
||||||
|
uint8_t next_store_index_ = 0;
|
||||||
#endif
|
#endif
|
||||||
TemplateAlarmControlPanelRestoreMode restore_mode_{};
|
TemplateAlarmControlPanelRestoreMode restore_mode_{};
|
||||||
|
|
||||||
@@ -154,14 +157,11 @@ class TemplateAlarmControlPanel final : public alarm_control_panel::AlarmControl
|
|||||||
uint32_t trigger_time_;
|
uint32_t trigger_time_;
|
||||||
// a list of codes
|
// a list of codes
|
||||||
std::vector<std::string> codes_;
|
std::vector<std::string> codes_;
|
||||||
// Per sensor data store
|
|
||||||
std::vector<SensorDataStore> sensor_data_;
|
|
||||||
// requires a code to arm
|
// requires a code to arm
|
||||||
bool requires_code_to_arm_ = false;
|
bool requires_code_to_arm_ = false;
|
||||||
bool supports_arm_home_ = false;
|
bool supports_arm_home_ = false;
|
||||||
bool supports_arm_night_ = false;
|
bool supports_arm_night_ = false;
|
||||||
bool sensors_ready_ = false;
|
bool sensors_ready_ = false;
|
||||||
uint8_t next_store_index_ = 0;
|
|
||||||
// check if the code is valid
|
// check if the code is valid
|
||||||
bool is_code_valid_(optional<std::string> code);
|
bool is_code_valid_(optional<std::string> code);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user