ESPHome 2026.3.0-dev
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::status {
14
15static const char *const TAG = "status";
16
19#ifdef USE_MQTT
20 if (mqtt::global_mqtt_client != nullptr) {
22 }
23#endif
24#ifdef USE_API
25 if (api::global_api_server != nullptr) {
27 }
28#endif
29
30 this->publish_state(status);
31}
33void StatusBinarySensor::dump_config() { LOG_BINARY_SENSOR("", "Status Binary Sensor", this); }
34
35} // namespace esphome::status
uint8_t status
Definition bl0942.h:8
bool is_connected(bool state_subscription_only=false) const
void publish_state(bool new_state)
Publish a new state to the front-end.
void publish_initial_state(bool new_state)
Publish the initial state, this will not make the callback manager send callbacks and is meant only f...
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:25