ESPHome 2025.5.0
Loading...
Searching...
No Matches
util.cpp
Go to the documentation of this file.
1#include "esphome/core/util.h"
5#include "esphome/core/log.h"
6
7#ifdef USE_API
9#endif
10
11#ifdef USE_MQTT
13#endif
14
15namespace esphome {
16
18#ifdef USE_API
19 if (api::global_api_server != nullptr) {
21 }
22#endif
23 return false;
24}
25
27#ifdef USE_MQTT
28 if (mqtt::global_mqtt_client != nullptr) {
30 }
31#endif
32 return false;
33}
34
36
37} // namespace esphome
APIServer * global_api_server
MQTTClientComponent * global_mqtt_client
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
bool remote_is_connected()
Return whether the node has any form of "remote" connection via the API or to an MQTT broker.
Definition util.cpp:35
bool api_is_connected()
Return whether the node has at least one client connected to the native API.
Definition util.cpp:17
bool mqtt_is_connected()
Return whether the node has an active connection to an MQTT broker.
Definition util.cpp:26