ESPHome  2024.11.1
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::http_request::HttpRequestSendAction< Ts > Class Template Reference

#include <http_request.h>

Inheritance diagram for esphome::http_request::HttpRequestSendAction< Ts >:
esphome::Action< Ts... >

Public Member Functions

 HttpRequestSendAction (HttpRequestComponent *parent)
 
 TEMPLATABLE_VALUE (std::string, url) TEMPLATABLE_VALUE(const char *
 
method TEMPLATABLE_VALUE (std::string, body) TEMPLATABLE_VALUE(bool
 
method capture_response void add_header (const char *key, TemplatableValue< const char *, Ts... > value)
 
void add_json (const char *key, TemplatableValue< std::string, Ts... > value)
 
void set_json (std::function< void(Ts..., JsonObject)> json_func)
 
void register_response_trigger (HttpRequestResponseTrigger *trigger)
 
void register_error_trigger (Trigger<> *trigger)
 
void set_max_response_buffer_size (size_t max_response_buffer_size)
 
void play (Ts... x) override
 
- Public Member Functions inherited from esphome::Action< Ts... >
virtual void play_complex (Ts... x)
 
virtual void stop_complex ()
 
virtual bool is_running ()
 Check if this or any of the following actions are currently running. More...
 
int num_running_total ()
 The total number of actions that are currently running in this plus any of the following actions in the chain. More...
 

Protected Member Functions

void encode_json_ (Ts... x, JsonObject root)
 
void encode_json_func_ (Ts... x, JsonObject root)
 
- Protected Member Functions inherited from esphome::Action< Ts... >
void play_next_ (Ts... x)
 
void play_next_tuple_ (const std::tuple< Ts... > &tuple, seq< S... >)
 
void play_next_tuple_ (const std::tuple< Ts... > &tuple)
 
virtual void stop ()
 
void stop_next_ ()
 
bool is_running_next_ ()
 

Protected Attributes

HttpRequestComponentparent_
 
std::map< const char *, TemplatableValue< const char *, Ts... > > headers_ {}
 
std::map< const char *, TemplatableValue< std::string, Ts... > > json_ {}
 
std::function< void(Ts..., JsonObject)> json_func_ {nullptr}
 
std::vector< HttpRequestResponseTrigger * > response_triggers_ {}
 
std::vector< Trigger<> * > error_triggers_ {}
 
size_t max_response_buffer_size_ {SIZE_MAX}
 
- Protected Attributes inherited from esphome::Action< Ts... >
friend ActionList< Ts... >
 
Action< Ts... > * next_
 
int num_running_
 The number of instances of this sequence in the list of actions that is currently being executed. More...
 

Detailed Description

template<typename... Ts>
class esphome::http_request::HttpRequestSendAction< Ts >

Definition at line 144 of file http_request.h.

Constructor & Destructor Documentation

◆ HttpRequestSendAction()

template<typename... Ts>
esphome::http_request::HttpRequestSendAction< Ts >::HttpRequestSendAction ( HttpRequestComponent parent)
inline

Definition at line 146 of file http_request.h.

Member Function Documentation

◆ add_header()

template<typename... Ts>
method capture_response void esphome::http_request::HttpRequestSendAction< Ts >::add_header ( const char *  key,
TemplatableValue< const char *, Ts... >  value 
)
inline

Definition at line 152 of file http_request.h.

◆ add_json()

template<typename... Ts>
void esphome::http_request::HttpRequestSendAction< Ts >::add_json ( const char *  key,
TemplatableValue< std::string, Ts... >  value 
)
inline

Definition at line 154 of file http_request.h.

◆ encode_json_()

template<typename... Ts>
void esphome::http_request::HttpRequestSendAction< Ts >::encode_json_ ( Ts...  x,
JsonObject  root 
)
inlineprotected

Definition at line 233 of file http_request.h.

◆ encode_json_func_()

template<typename... Ts>
void esphome::http_request::HttpRequestSendAction< Ts >::encode_json_func_ ( Ts...  x,
JsonObject  root 
)
inlineprotected

Definition at line 239 of file http_request.h.

◆ play()

template<typename... Ts>
void esphome::http_request::HttpRequestSendAction< Ts >::play ( Ts...  x)
inlineoverridevirtual

Implements esphome::Action< Ts... >.

Definition at line 166 of file http_request.h.

◆ register_error_trigger()

template<typename... Ts>
void esphome::http_request::HttpRequestSendAction< Ts >::register_error_trigger ( Trigger<> *  trigger)
inline

Definition at line 160 of file http_request.h.

◆ register_response_trigger()

template<typename... Ts>
void esphome::http_request::HttpRequestSendAction< Ts >::register_response_trigger ( HttpRequestResponseTrigger trigger)
inline

Definition at line 158 of file http_request.h.

◆ set_json()

template<typename... Ts>
void esphome::http_request::HttpRequestSendAction< Ts >::set_json ( std::function< void(Ts..., JsonObject)>  json_func)
inline

Definition at line 156 of file http_request.h.

◆ set_max_response_buffer_size()

template<typename... Ts>
void esphome::http_request::HttpRequestSendAction< Ts >::set_max_response_buffer_size ( size_t  max_response_buffer_size)
inline

Definition at line 162 of file http_request.h.

◆ TEMPLATABLE_VALUE() [1/2]

template<typename... Ts>
esphome::http_request::HttpRequestSendAction< Ts >::TEMPLATABLE_VALUE ( std::string  ,
url   
) const

◆ TEMPLATABLE_VALUE() [2/2]

template<typename... Ts>
method esphome::http_request::HttpRequestSendAction< Ts >::TEMPLATABLE_VALUE ( std::string  ,
body   
)

Field Documentation

◆ error_triggers_

template<typename... Ts>
std::vector<Trigger<> *> esphome::http_request::HttpRequestSendAction< Ts >::error_triggers_ {}
protected

Definition at line 245 of file http_request.h.

◆ headers_

template<typename... Ts>
std::map<const char *, TemplatableValue<const char *, Ts...> > esphome::http_request::HttpRequestSendAction< Ts >::headers_ {}
protected

Definition at line 241 of file http_request.h.

◆ json_

template<typename... Ts>
std::map<const char *, TemplatableValue<std::string, Ts...> > esphome::http_request::HttpRequestSendAction< Ts >::json_ {}
protected

Definition at line 242 of file http_request.h.

◆ json_func_

template<typename... Ts>
std::function<void(Ts..., JsonObject)> esphome::http_request::HttpRequestSendAction< Ts >::json_func_ {nullptr}
protected

Definition at line 243 of file http_request.h.

◆ max_response_buffer_size_

template<typename... Ts>
size_t esphome::http_request::HttpRequestSendAction< Ts >::max_response_buffer_size_ {SIZE_MAX}
protected

Definition at line 247 of file http_request.h.

◆ parent_

template<typename... Ts>
HttpRequestComponent* esphome::http_request::HttpRequestSendAction< Ts >::parent_
protected

Definition at line 240 of file http_request.h.

◆ response_triggers_

template<typename... Ts>
std::vector<HttpRequestResponseTrigger *> esphome::http_request::HttpRequestSendAction< Ts >::response_triggers_ {}
protected

Definition at line 244 of file http_request.h.


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