ESPHome  2024.10.2
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::alarm_control_panel::AlarmControlPanel Class Referenceabstract

#include <alarm_control_panel.h>

Inheritance diagram for esphome::alarm_control_panel::AlarmControlPanel:
esphome::EntityBase esphome::template_::TemplateAlarmControlPanel

Public Member Functions

AlarmControlPanelCall make_call ()
 Make a AlarmControlPanelCall. More...
 
void publish_state (AlarmControlPanelState state)
 Set the state of the alarm_control_panel. More...
 
void add_on_state_callback (std::function< void()> &&callback)
 Add a callback for when the state of the alarm_control_panel changes. More...
 
void add_on_triggered_callback (std::function< void()> &&callback)
 Add a callback for when the state of the alarm_control_panel chanes to triggered. More...
 
void add_on_arming_callback (std::function< void()> &&callback)
 Add a callback for when the state of the alarm_control_panel chanes to arming. More...
 
void add_on_pending_callback (std::function< void()> &&callback)
 Add a callback for when the state of the alarm_control_panel changes to pending. More...
 
void add_on_armed_home_callback (std::function< void()> &&callback)
 Add a callback for when the state of the alarm_control_panel changes to armed_home. More...
 
void add_on_armed_night_callback (std::function< void()> &&callback)
 Add a callback for when the state of the alarm_control_panel changes to armed_night. More...
 
void add_on_armed_away_callback (std::function< void()> &&callback)
 Add a callback for when the state of the alarm_control_panel changes to armed_away. More...
 
void add_on_disarmed_callback (std::function< void()> &&callback)
 Add a callback for when the state of the alarm_control_panel changes to disarmed. More...
 
void add_on_cleared_callback (std::function< void()> &&callback)
 Add a callback for when the state of the alarm_control_panel clears from triggered. More...
 
void add_on_chime_callback (std::function< void()> &&callback)
 Add a callback for when a chime zone goes from closed to open. More...
 
void add_on_ready_callback (std::function< void()> &&callback)
 Add a callback for when a ready state changes. More...
 
virtual uint32_t get_supported_features () const =0
 A numeric representation of the supported features as per HomeAssistant. More...
 
virtual bool get_requires_code () const =0
 Returns if the alarm_control_panel has a code. More...
 
virtual bool get_requires_code_to_arm () const =0
 Returns if the alarm_control_panel requires a code to arm. More...
 
void arm_away (optional< std::string > code=nullopt)
 arm the alarm in away mode More...
 
void arm_home (optional< std::string > code=nullopt)
 arm the alarm in home mode More...
 
void arm_night (optional< std::string > code=nullopt)
 arm the alarm in night mode More...
 
void arm_vacation (optional< std::string > code=nullopt)
 arm the alarm in vacation mode More...
 
void arm_custom_bypass (optional< std::string > code=nullopt)
 arm the alarm in custom bypass mode More...
 
void disarm (optional< std::string > code=nullopt)
 disarm the alarm More...
 
AlarmControlPanelState get_state () const
 Get the state. More...
 
bool is_state_armed (AlarmControlPanelState state)
 
- Public Member Functions inherited from esphome::EntityBase
const StringRefget_name () const
 
void set_name (const char *name)
 
bool has_own_name () const
 
std::string get_object_id () const
 
void set_object_id (const char *object_id)
 
uint32_t get_object_id_hash ()
 
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)
 
std::string get_icon () const
 
void set_icon (const char *icon)
 

Protected Member Functions

virtual void control (const AlarmControlPanelCall &call)=0
 
- Protected Member Functions inherited from esphome::EntityBase
virtual uint32_t hash_base ()
 The hash_base() function has been deprecated. More...
 
void calc_object_id_ ()
 

Protected Attributes

friend AlarmControlPanelCall
 
ESPPreferenceObject pref_
 
AlarmControlPanelState current_state_
 
AlarmControlPanelState desired_state_
 
uint32_t last_update_
 
CallbackManager< void()> state_callback_ {}
 
CallbackManager< void()> triggered_callback_ {}
 
CallbackManager< void()> arming_callback_ {}
 
CallbackManager< void()> pending_callback_ {}
 
CallbackManager< void()> armed_home_callback_ {}
 
CallbackManager< void()> armed_night_callback_ {}
 
CallbackManager< void()> armed_away_callback_ {}
 
CallbackManager< void()> disarmed_callback_ {}
 
CallbackManager< void()> cleared_callback_ {}
 
CallbackManager< void()> chime_callback_ {}
 
CallbackManager< 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_
 
bool has_own_name_ {false}
 
bool internal_ {false}
 
bool disabled_by_default_ {false}
 
EntityCategory entity_category_ {ENTITY_CATEGORY_NONE}
 

Detailed Description

Definition at line 25 of file alarm_control_panel.h.

Member Function Documentation

◆ add_on_armed_away_callback()

void esphome::alarm_control_panel::AlarmControlPanel::add_on_armed_away_callback ( std::function< void()> &&  callback)

Add a callback for when the state of the alarm_control_panel changes to armed_away.

Parameters
callbackThe callback function

Definition at line 83 of file alarm_control_panel.cpp.

◆ add_on_armed_home_callback()

void esphome::alarm_control_panel::AlarmControlPanel::add_on_armed_home_callback ( std::function< void()> &&  callback)

Add a callback for when the state of the alarm_control_panel changes to armed_home.

Parameters
callbackThe callback function

Definition at line 75 of file alarm_control_panel.cpp.

◆ add_on_armed_night_callback()

void esphome::alarm_control_panel::AlarmControlPanel::add_on_armed_night_callback ( std::function< void()> &&  callback)

Add a callback for when the state of the alarm_control_panel changes to armed_night.

Parameters
callbackThe callback function

Definition at line 79 of file alarm_control_panel.cpp.

◆ add_on_arming_callback()

void esphome::alarm_control_panel::AlarmControlPanel::add_on_arming_callback ( std::function< void()> &&  callback)

Add a callback for when the state of the alarm_control_panel chanes to arming.

Parameters
callbackThe callback function

Definition at line 71 of file alarm_control_panel.cpp.

◆ add_on_chime_callback()

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.

Parameters
callbackThe callback function

Definition at line 99 of file alarm_control_panel.cpp.

◆ add_on_cleared_callback()

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.

Parameters
callbackThe callback function

Definition at line 95 of file alarm_control_panel.cpp.

◆ add_on_disarmed_callback()

void esphome::alarm_control_panel::AlarmControlPanel::add_on_disarmed_callback ( std::function< void()> &&  callback)

Add a callback for when the state of the alarm_control_panel changes to disarmed.

Parameters
callbackThe callback function

Definition at line 91 of file alarm_control_panel.cpp.

◆ add_on_pending_callback()

void esphome::alarm_control_panel::AlarmControlPanel::add_on_pending_callback ( std::function< void()> &&  callback)

Add a callback for when the state of the alarm_control_panel changes to pending.

Parameters
callbackThe callback function

Definition at line 87 of file alarm_control_panel.cpp.

◆ add_on_ready_callback()

void esphome::alarm_control_panel::AlarmControlPanel::add_on_ready_callback ( std::function< void()> &&  callback)

Add a callback for when a ready state changes.

Parameters
callbackThe callback function

Definition at line 103 of file alarm_control_panel.cpp.

◆ add_on_state_callback()

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.

Parameters
callbackThe callback function

Definition at line 63 of file alarm_control_panel.cpp.

◆ add_on_triggered_callback()

void esphome::alarm_control_panel::AlarmControlPanel::add_on_triggered_callback ( std::function< void()> &&  callback)

Add a callback for when the state of the alarm_control_panel chanes to triggered.

Parameters
callbackThe callback function

Definition at line 67 of file alarm_control_panel.cpp.

◆ arm_away()

void esphome::alarm_control_panel::AlarmControlPanel::arm_away ( optional< std::string >  code = nullopt)

arm the alarm in away mode

Parameters
codeThe code

Definition at line 107 of file alarm_control_panel.cpp.

◆ arm_custom_bypass()

void esphome::alarm_control_panel::AlarmControlPanel::arm_custom_bypass ( optional< std::string >  code = nullopt)

arm the alarm in custom bypass mode

Parameters
codeThe code

Definition at line 139 of file alarm_control_panel.cpp.

◆ arm_home()

void esphome::alarm_control_panel::AlarmControlPanel::arm_home ( optional< std::string >  code = nullopt)

arm the alarm in home mode

Parameters
codeThe code

Definition at line 115 of file alarm_control_panel.cpp.

◆ arm_night()

void esphome::alarm_control_panel::AlarmControlPanel::arm_night ( optional< std::string >  code = nullopt)

arm the alarm in night mode

Parameters
codeThe code

Definition at line 123 of file alarm_control_panel.cpp.

◆ arm_vacation()

void esphome::alarm_control_panel::AlarmControlPanel::arm_vacation ( optional< std::string >  code = nullopt)

arm the alarm in vacation mode

Parameters
codeThe code

Definition at line 131 of file alarm_control_panel.cpp.

◆ control()

virtual void esphome::alarm_control_panel::AlarmControlPanel::control ( const AlarmControlPanelCall call)
protectedpure virtual

◆ disarm()

void esphome::alarm_control_panel::AlarmControlPanel::disarm ( optional< std::string >  code = nullopt)

disarm the alarm

Parameters
codeThe code

Definition at line 147 of file alarm_control_panel.cpp.

◆ get_requires_code()

virtual bool esphome::alarm_control_panel::AlarmControlPanel::get_requires_code ( ) const
pure virtual

Returns if the alarm_control_panel has a code.

Implemented in esphome::template_::TemplateAlarmControlPanel.

◆ get_requires_code_to_arm()

virtual bool esphome::alarm_control_panel::AlarmControlPanel::get_requires_code_to_arm ( ) const
pure virtual

Returns if the alarm_control_panel requires a code to arm.

Implemented in esphome::template_::TemplateAlarmControlPanel.

◆ get_state()

AlarmControlPanelState esphome::alarm_control_panel::AlarmControlPanel::get_state ( ) const
inline

Get the state.

Definition at line 158 of file alarm_control_panel.h.

◆ get_supported_features()

virtual uint32_t esphome::alarm_control_panel::AlarmControlPanel::get_supported_features ( ) const
pure virtual

A numeric representation of the supported features as per HomeAssistant.

Implemented in esphome::template_::TemplateAlarmControlPanel.

◆ is_state_armed()

bool esphome::alarm_control_panel::AlarmControlPanel::is_state_armed ( AlarmControlPanelState  state)

Definition at line 16 of file alarm_control_panel.cpp.

◆ make_call()

AlarmControlPanelCall esphome::alarm_control_panel::AlarmControlPanel::make_call ( )

Make a AlarmControlPanelCall.

Definition at line 14 of file alarm_control_panel.cpp.

◆ publish_state()

void esphome::alarm_control_panel::AlarmControlPanel::publish_state ( AlarmControlPanelState  state)

Set the state of the alarm_control_panel.

Parameters
stateThe AlarmControlPanelState.

Definition at line 29 of file alarm_control_panel.cpp.

Field Documentation

◆ AlarmControlPanelCall

friend esphome::alarm_control_panel::AlarmControlPanel::AlarmControlPanelCall
protected

Definition at line 164 of file alarm_control_panel.h.

◆ armed_away_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::armed_away_callback_ {}
protected

Definition at line 188 of file alarm_control_panel.h.

◆ armed_home_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::armed_home_callback_ {}
protected

Definition at line 184 of file alarm_control_panel.h.

◆ armed_night_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::armed_night_callback_ {}
protected

Definition at line 186 of file alarm_control_panel.h.

◆ arming_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::arming_callback_ {}
protected

Definition at line 180 of file alarm_control_panel.h.

◆ chime_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::chime_callback_ {}
protected

Definition at line 194 of file alarm_control_panel.h.

◆ cleared_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::cleared_callback_ {}
protected

Definition at line 192 of file alarm_control_panel.h.

◆ current_state_

AlarmControlPanelState esphome::alarm_control_panel::AlarmControlPanel::current_state_
protected

Definition at line 168 of file alarm_control_panel.h.

◆ desired_state_

AlarmControlPanelState esphome::alarm_control_panel::AlarmControlPanel::desired_state_
protected

Definition at line 170 of file alarm_control_panel.h.

◆ disarmed_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::disarmed_callback_ {}
protected

Definition at line 190 of file alarm_control_panel.h.

◆ last_update_

uint32_t esphome::alarm_control_panel::AlarmControlPanel::last_update_
protected

Definition at line 172 of file alarm_control_panel.h.

◆ pending_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::pending_callback_ {}
protected

Definition at line 182 of file alarm_control_panel.h.

◆ pref_

ESPPreferenceObject esphome::alarm_control_panel::AlarmControlPanel::pref_
protected

Definition at line 166 of file alarm_control_panel.h.

◆ ready_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::ready_callback_ {}
protected

Definition at line 196 of file alarm_control_panel.h.

◆ state_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::state_callback_ {}
protected

Definition at line 176 of file alarm_control_panel.h.

◆ triggered_callback_

CallbackManager<void()> esphome::alarm_control_panel::AlarmControlPanel::triggered_callback_ {}
protected

Definition at line 178 of file alarm_control_panel.h.


The documentation for this class was generated from the following files: