ESPHome  2024.2.0
Public Member Functions | Data Fields | 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) void add_header(const char *key
 
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 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...
 

Data Fields

method TemplatableValue< const char *, Ts... > value { this->headers_.insert({key, value})
 

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_
 
- 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 77 of file http_request.h.

Constructor & Destructor Documentation

◆ HttpRequestSendAction()

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

Definition at line 79 of file http_request.h.

Member Function Documentation

◆ 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 86 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 121 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 127 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 92 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 90 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 88 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   
) const

Field Documentation

◆ headers_

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

Definition at line 129 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 130 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 131 of file http_request.h.

◆ parent_

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

Definition at line 128 of file http_request.h.

◆ response_triggers_

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

Definition at line 132 of file http_request.h.

◆ value

template<typename... Ts>
method TemplatableValue<const char *, Ts...> esphome::http_request::HttpRequestSendAction< Ts >::value { this->headers_.insert({key, value})

Definition at line 84 of file http_request.h.


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