ESPHome 2026.6.0-dev
Loading...
Searching...
No Matches
util.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
7
8#ifdef USE_API
10#endif
11
12namespace esphome {
13
19#ifdef USE_API
20ESPHOME_ALWAYS_INLINE inline bool api_is_connected() {
22}
23#else
24ESPHOME_ALWAYS_INLINE inline bool api_is_connected() { return false; }
25#endif
26
29
32
33} // namespace esphome
bool is_connected() const
Definition api_server.h:190
APIServer * global_api_server
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:21
ESPHOME_ALWAYS_INLINE bool api_is_connected()
Return whether the node has at least one client connected to the native API.
Definition util.h:20
bool mqtt_is_connected()
Return whether the node has an active connection to an MQTT broker.
Definition util.cpp:12