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); });
166 auto recipient = this->recipient_.value(
x...);
167 auto message = this->message_.value(
x...);
181 auto ussd_code = this->ussd_.value(
x...);
195 auto recipient = this->recipient_.value(
x...);
virtual void play(Ts... x)=0
This class simplifies creating components that periodically check a state.
Base class for all binary_sensor-type classes.
Base-class for all sensors.
Sim800LCallConnectedTrigger(Sim800LComponent *parent)
Sim800LCallDisconnectedTrigger(Sim800LComponent *parent)
sensor::Sensor * rssi_sensor_
char read_buffer_[SIM800L_READ_BUFFER_LENGTH]
void add_on_incoming_call_callback(std::function< void(std::string)> callback)
CallbackManager< void(std::string)> ussd_received_callback_
void add_on_call_disconnected_callback(std::function< void()> callback)
void send_cmd_(const std::string &message)
CallbackManager< void(std::string, std::string)> sms_received_callback_
void add_on_ussd_received_callback(std::function< void(std::string)> callback)
CallbackManager< void(std::string)> incoming_call_callback_
binary_sensor::BinarySensor * registered_binary_sensor_
CallbackManager< void()> call_connected_callback_
void dump_config() override
void set_registered_(bool registered)
void add_on_call_connected_callback(std::function< void()> callback)
void send_sms(const std::string &recipient, const std::string &message)
void update() override
Retrieve the latest sensor values. This operation takes approximately 16ms.
void set_rssi_sensor(sensor::Sensor *rssi_sensor)
void parse_cmd_(std::string message)
CallbackManager< void()> call_disconnected_callback_
void dial(const std::string &recipient)
std::string outgoing_message_
void send_ussd(const std::string &ussd_code)
void add_on_sms_received_callback(std::function< void(std::string, std::string)> callback)
void set_registered_binary_sensor(binary_sensor::BinarySensor *registered_binary_sensor)
Sim800LConnectAction(Sim800LComponent *parent)
Sim800LComponent * parent_
Sim800LDialAction(Sim800LComponent *parent)
Sim800LComponent * parent_
TEMPLATABLE_VALUE(std::string, recipient) void play(Ts... x)
Sim800LComponent * parent_
Sim800LDisconnectAction(Sim800LComponent *parent)
Sim800LIncomingCallTrigger(Sim800LComponent *parent)
Sim800LReceivedMessageTrigger(Sim800LComponent *parent)
Sim800LReceivedUssdTrigger(Sim800LComponent *parent)
Sim800LSendSmsAction(Sim800LComponent *parent)
TEMPLATABLE_VALUE(std::string, recipient) TEMPLATABLE_VALUE(std
Sim800LComponent * parent_
Sim800LSendUssdAction(Sim800LComponent *parent)
Sim800LComponent * parent_
TEMPLATABLE_VALUE(std::string, ussd) void play(Ts... x)
@ STATE_PARSE_SMS_RESPONSE
const uint16_t SIM800L_READ_BUFFER_LENGTH
Providing packet encoding functions for exchanging data with a remote host.