mirror of
https://github.com/esphome/esphome.git
synced 2026-09-17 01:58:39 +00:00
reduce
This commit is contained in:
@@ -60,16 +60,6 @@ class AlarmControlPanel : public EntityBase {
|
||||
*/
|
||||
void add_on_ready_callback(std::function<void()> &&callback);
|
||||
|
||||
/** Notify chime event listeners
|
||||
*
|
||||
*/
|
||||
void notify_chime() { this->chime_callback_.call(); }
|
||||
|
||||
/** Notify ready state change listeners
|
||||
*
|
||||
*/
|
||||
void notify_ready() { this->ready_callback_.call(); }
|
||||
|
||||
/** A numeric representation of the supported features as per HomeAssistant
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -133,7 +133,7 @@ void TemplateAlarmControlPanel::loop() {
|
||||
if ((!this->sensor_data_[info.store_index].last_chime_state) && (sensor->state)) {
|
||||
// Must be disarmed to chime
|
||||
if (this->current_state_ == ACP_STATE_DISARMED) {
|
||||
this->notify_chime();
|
||||
this->chime_callback_.call();
|
||||
}
|
||||
}
|
||||
// Record the sensor state change
|
||||
@@ -182,7 +182,7 @@ void TemplateAlarmControlPanel::loop() {
|
||||
// Call the ready state change callback if there was a change
|
||||
if (this->sensors_ready_ != sensors_ready) {
|
||||
this->sensors_ready_ = sensors_ready;
|
||||
this->notify_ready();
|
||||
this->ready_callback_.call();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user