ESPHome  2024.9.2
util.cpp
Go to the documentation of this file.
1 #include "esphome/core/util.h"
2 #include "esphome/core/defines.h"
4 #include "esphome/core/version.h"
5 #include "esphome/core/log.h"
6 
7 #ifdef USE_API
9 #endif
10 
11 #ifdef USE_MQTT
13 #endif
14 
15 namespace 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
bool is_connected() const
Definition: api_server.cpp:387
bool api_is_connected()
Return whether the node has at least one client connected to the native API.
Definition: util.cpp:17
MQTTClientComponent * global_mqtt_client
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
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7
bool mqtt_is_connected()
Return whether the node has an active connection to an MQTT broker.
Definition: util.cpp:26
APIServer * global_api_server
Definition: api_server.cpp:346