7 #ifdef USE_BINARY_SENSOR 56 #ifdef USE_BINARY_SENSOR 79 void send_sms(
const std::string &recipient,
const std::string &message);
80 void send_ussd(
const std::string &ussd_code);
81 void dial(
const std::string &recipient);
86 void send_cmd_(
const std::string &message);
90 #ifdef USE_BINARY_SENSOR 128 [
this](
const std::string &message,
const std::string &sender) { this->trigger(message, sender); });
163 TEMPLATABLE_VALUE(std::string, message)
167 auto message = this->
message_.value(
x...);
168 this->
parent_->send_sms(recipient, message);
181 auto ussd_code = this->
ussd_.value(
x...);
182 this->
parent_->send_ussd(ussd_code);
196 this->
parent_->dial(recipient);
CallbackManager< void(std::string)> ussd_received_callback_
Sim800LIncomingCallTrigger(Sim800LComponent *parent)
Sim800LComponent * parent_
CallbackManager< void(std::string, std::string)> sms_received_callback_
Sim800LComponent * parent_
void send_cmd_(const std::string &message)
void send_sms(const std::string &recipient, const std::string &message)
Sim800LCallConnectedTrigger(Sim800LComponent *parent)
void add_on_sms_received_callback(std::function< void(std::string, std::string)> callback)
CallbackManager< void()> call_disconnected_callback_
void set_registered_binary_sensor(binary_sensor::BinarySensor *registered_binary_sensor)
This class simplifies creating components that periodically check a state.
Sim800LComponent * parent_
void add_on_incoming_call_callback(std::function< void(std::string)> callback)
Sim800LDialAction(Sim800LComponent *parent)
void set_rssi_sensor(sensor::Sensor *rssi_sensor)
Sim800LComponent * parent_
void update() override
Retrieve the latest sensor values. This operation takes approximately 16ms.
Sim800LComponent * parent_
void parse_cmd_(std::string message)
Sim800LReceivedUssdTrigger(Sim800LComponent *parent)
Sim800LCallDisconnectedTrigger(Sim800LComponent *parent)
TEMPLATABLE_VALUE(std::string, recipient) void play(Ts... x)
char read_buffer_[SIM800L_READ_BUFFER_LENGTH]
binary_sensor::BinarySensor * registered_binary_sensor_
void send_ussd(const std::string &ussd_code)
void dump_config() override
sensor::Sensor * rssi_sensor_
CallbackManager< void(std::string)> incoming_call_callback_
void dial(const std::string &recipient)
CallbackManager< void()> call_connected_callback_
void add_on_call_disconnected_callback(std::function< void()> callback)
void add_on_call_connected_callback(std::function< void()> callback)
TEMPLATABLE_VALUE(std::string, recipient) TEMPLATABLE_VALUE(std
void set_registered_(bool registered)
Sim800LConnectAction(Sim800LComponent *parent)
Implementation of SPI Controller mode.
Base class for all binary_sensor-type classes.
Base-class for all sensors.
const uint16_t SIM800L_READ_BUFFER_LENGTH
TEMPLATABLE_VALUE(std::string, ussd) void play(Ts... x)
std::string outgoing_message_
void add_on_ussd_received_callback(std::function< void(std::string)> callback)
Sim800LReceivedMessageTrigger(Sim800LComponent *parent)
Sim800LDisconnectAction(Sim800LComponent *parent)
Sim800LSendSmsAction(Sim800LComponent *parent)
Sim800LSendUssdAction(Sim800LComponent *parent)