ESPHome 2025.5.0
Loading...
Searching...
No Matches
status_binary_sensor.cpp
Go to the documentation of this file.
2#include "esphome/core/log.h"
5
6#ifdef USE_MQTT
8#endif
9#ifdef USE_API
11#endif
12
13namespace esphome {
14namespace status {
15
16static const char *const TAG = "status";
17
20#ifdef USE_MQTT
21 if (mqtt::global_mqtt_client != nullptr) {
23 }
24#endif
25#ifdef USE_API
26 if (api::global_api_server != nullptr) {
28 }
29#endif
30
31 this->publish_state(status);
32}
34void StatusBinarySensor::dump_config() { LOG_BINARY_SENSOR("", "Status Binary Sensor", this); }
35
36} // namespace status
37} // namespace esphome
uint8_t status
Definition bl0942.h:8
void publish_initial_state(bool state)
Publish the initial state, this will not make the callback manager send callbacks and is meant only f...
void publish_state(bool state)
Publish a new state to the front-end.
APIServer * global_api_server
MQTTClientComponent * global_mqtt_client
bool is_connected()
Return whether the node is connected to the network (through wifi, eth, ...)
Definition util.cpp:15
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7