|
ESPHome 2026.1.0-dev
|
#include <alarm_control_panel.h>
Public Member Functions | |
| AlarmControlPanelCall | make_call () |
| Make a AlarmControlPanelCall. | |
| void | publish_state (AlarmControlPanelState state) |
| Set the state of the alarm_control_panel. | |
| void | add_on_state_callback (std::function< void()> &&callback) |
| Add a callback for when the state of the alarm_control_panel changes. | |
| void | add_on_cleared_callback (std::function< void()> &&callback) |
| Add a callback for when the state of the alarm_control_panel clears from triggered. | |
| void | add_on_chime_callback (std::function< void()> &&callback) |
| Add a callback for when a chime zone goes from closed to open. | |
| void | add_on_ready_callback (std::function< void()> &&callback) |
| Add a callback for when a ready state changes. | |
| virtual uint32_t | get_supported_features () const =0 |
| A numeric representation of the supported features as per HomeAssistant. | |
| virtual bool | get_requires_code () const =0 |
| Returns if the alarm_control_panel has a code. | |
| virtual bool | get_requires_code_to_arm () const =0 |
| Returns if the alarm_control_panel requires a code to arm. | |
| void | arm_away (optional< std::string > code=nullopt) |
| arm the alarm in away mode | |
| void | arm_home (optional< std::string > code=nullopt) |
| arm the alarm in home mode | |
| void | arm_night (optional< std::string > code=nullopt) |
| arm the alarm in night mode | |
| void | arm_vacation (optional< std::string > code=nullopt) |
| arm the alarm in vacation mode | |
| void | arm_custom_bypass (optional< std::string > code=nullopt) |
| arm the alarm in custom bypass mode | |
| void | disarm (optional< std::string > code=nullopt) |
| disarm the alarm | |
| AlarmControlPanelState | get_state () const |
| Get the state. | |
| bool | is_state_armed (AlarmControlPanelState state) |
Public Member Functions inherited from esphome::EntityBase | |
| const StringRef & | get_name () const |
| void | set_name (const char *name) |
| bool | has_own_name () const |
| ESPDEPRECATED("object_id mangles names and all object_id methods are planned for removal " "(see https://github.com/esphome/backlog/issues/76). " "Now is the time to stop using object_id. If still needed, use get_object_id_to() " "which will remain available longer. get_object_id() will be removed in 2026.7.0", "2025.12.0") std void | set_object_id (const char *object_id) |
| void | set_name_and_object_id (const char *name, const char *object_id) |
| uint32_t | get_object_id_hash () |
| StringRef | get_object_id_to (std::span< char, OBJECT_ID_MAX_LEN > buf) const |
| Get object_id with zero heap allocation For static case: returns StringRef to internal storage (buffer unused) For dynamic case: formats into buffer and returns StringRef to buffer. | |
| size_t | write_object_id_to (char *buf, size_t buf_size) const |
| Write object_id directly to buffer, returns length written (excluding null) Useful for building compound strings without intermediate buffer. | |
| bool | is_internal () const |
| void | set_internal (bool internal) |
| bool | is_disabled_by_default () const |
| void | set_disabled_by_default (bool disabled_by_default) |
| EntityCategory | get_entity_category () const |
| void | set_entity_category (EntityCategory entity_category) |
| ESPDEPRECATED("Use get_icon_ref() instead for better performance (avoids string copy). Will be removed in ESPHome 2026.5.0", "2025.11.0") std void | set_icon (const char *icon) |
| StringRef | get_icon_ref () const |
| uint32_t | get_device_id () const |
| void | set_device (Device *device) |
| bool | has_state () const |
| void | set_has_state (bool state) |
| uint32_t | get_preference_hash () |
| Get a unique hash for storing preferences/settings for this entity. | |
Protected Member Functions | |
| virtual void | control (const AlarmControlPanelCall &call)=0 |
Protected Member Functions inherited from esphome::EntityBase | |
| void | calc_object_id_ () |
| bool | is_object_id_dynamic_ () const |
| Check if the object_id is dynamic (changes with MAC suffix) | |
Protected Attributes | |
| friend | AlarmControlPanelCall |
| ESPPreferenceObject | pref_ |
| AlarmControlPanelState | current_state_ |
| AlarmControlPanelState | desired_state_ |
| uint32_t | last_update_ |
| LazyCallbackManager< void()> | state_callback_ {} |
| LazyCallbackManager< void()> | cleared_callback_ {} |
| LazyCallbackManager< void()> | chime_callback_ {} |
| LazyCallbackManager< void()> | ready_callback_ {} |
Protected Attributes inherited from esphome::EntityBase | |
| StringRef | name_ |
| const char * | object_id_c_str_ {nullptr} |
| const char * | icon_c_str_ {nullptr} |
| uint32_t | object_id_hash_ {} |
| Device * | device_ {} |
| struct esphome::EntityBase::EntityFlags | flags_ |
Definition at line 22 of file alarm_control_panel.h.
| void esphome::alarm_control_panel::AlarmControlPanel::add_on_chime_callback | ( | std::function< void()> && | callback | ) |
Add a callback for when a chime zone goes from closed to open.
| callback | The callback function |
Definition at line 61 of file alarm_control_panel.cpp.
| void esphome::alarm_control_panel::AlarmControlPanel::add_on_cleared_callback | ( | std::function< void()> && | callback | ) |
Add a callback for when the state of the alarm_control_panel clears from triggered.
| callback | The callback function |
Definition at line 57 of file alarm_control_panel.cpp.
| void esphome::alarm_control_panel::AlarmControlPanel::add_on_ready_callback | ( | std::function< void()> && | callback | ) |
Add a callback for when a ready state changes.
| callback | The callback function |
Definition at line 65 of file alarm_control_panel.cpp.
| void esphome::alarm_control_panel::AlarmControlPanel::add_on_state_callback | ( | std::function< void()> && | callback | ) |
Add a callback for when the state of the alarm_control_panel changes.
Triggers can check get_state() to determine the new state.
| callback | The callback function |
Definition at line 53 of file alarm_control_panel.cpp.
| void esphome::alarm_control_panel::AlarmControlPanel::arm_away | ( | optional< std::string > | code = nullopt | ) |
arm the alarm in away mode
| code | The code |
Definition at line 69 of file alarm_control_panel.cpp.
| void esphome::alarm_control_panel::AlarmControlPanel::arm_custom_bypass | ( | optional< std::string > | code = nullopt | ) |
arm the alarm in custom bypass mode
| code | The code |
Definition at line 101 of file alarm_control_panel.cpp.
| void esphome::alarm_control_panel::AlarmControlPanel::arm_home | ( | optional< std::string > | code = nullopt | ) |
arm the alarm in home mode
| code | The code |
Definition at line 77 of file alarm_control_panel.cpp.
| void esphome::alarm_control_panel::AlarmControlPanel::arm_night | ( | optional< std::string > | code = nullopt | ) |
arm the alarm in night mode
| code | The code |
Definition at line 85 of file alarm_control_panel.cpp.
| void esphome::alarm_control_panel::AlarmControlPanel::arm_vacation | ( | optional< std::string > | code = nullopt | ) |
arm the alarm in vacation mode
| code | The code |
Definition at line 93 of file alarm_control_panel.cpp.
|
protectedpure virtual |
Implemented in esphome::demo::DemoAlarmControlPanel, and esphome::template_::TemplateAlarmControlPanel.
|
pure virtual |
Returns if the alarm_control_panel has a code.
Implemented in esphome::demo::DemoAlarmControlPanel, and esphome::template_::TemplateAlarmControlPanel.
|
pure virtual |
Returns if the alarm_control_panel requires a code to arm.
Implemented in esphome::demo::DemoAlarmControlPanel, and esphome::template_::TemplateAlarmControlPanel.
|
inline |
Get the state.
Definition at line 114 of file alarm_control_panel.h.
|
pure virtual |
A numeric representation of the supported features as per HomeAssistant.
Implemented in esphome::demo::DemoAlarmControlPanel, and esphome::template_::TemplateAlarmControlPanel.
| bool esphome::alarm_control_panel::AlarmControlPanel::is_state_armed | ( | AlarmControlPanelState | state | ) |
Definition at line 17 of file alarm_control_panel.cpp.
| AlarmControlPanelCall esphome::alarm_control_panel::AlarmControlPanel::make_call | ( | ) |
Make a AlarmControlPanelCall.
Definition at line 15 of file alarm_control_panel.cpp.
| void esphome::alarm_control_panel::AlarmControlPanel::publish_state | ( | AlarmControlPanelState | state | ) |
Set the state of the alarm_control_panel.
| state | The AlarmControlPanelState. |
Definition at line 30 of file alarm_control_panel.cpp.
|
protected |
Definition at line 120 of file alarm_control_panel.h.
|
protected |
Definition at line 136 of file alarm_control_panel.h.
|
protected |
Definition at line 134 of file alarm_control_panel.h.
|
protected |
Definition at line 124 of file alarm_control_panel.h.
|
protected |
Definition at line 126 of file alarm_control_panel.h.
|
protected |
Definition at line 128 of file alarm_control_panel.h.
|
protected |
Definition at line 122 of file alarm_control_panel.h.
|
protected |
Definition at line 138 of file alarm_control_panel.h.
|
protected |
Definition at line 132 of file alarm_control_panel.h.