mirror of
https://github.com/Threnklyn/esphome-dev.git
synced 2026-05-20 04:53:28 +02:00
924df1e7de
* Add macros header with more usable Arduino version defines * Change Arduino version checking to use our version defines * Add missing ESP8266 check * Rename Arduino version macro to ARDUINO_VERSION_CODE * Upgrade clang-tidy to use Arduino 3 * Fix clang-tidy warnings * Upgrade NeoPixelBus to upstream 2.6.7 * Use Arduino-version-appropriate API to set redirect flags * Remove now unnecessary CLANG_TIDY ifdefs * Add preprocessor hackery to avoid including pgmspace.h * Bump base image to 4.1.1 and update lint * Fix nfctag * Fix make_unique ambiguous * Fix ignore name * Fix ambiguous v2 * Remove unused begin * Cast time_t to prevent issues on platforms where time_t is 32bit Co-authored-by: Otto winter <otto@otto-winter.com>
33 lines
904 B
C++
33 lines
904 B
C++
#pragma once
|
|
|
|
#include <string>
|
|
#include "IPAddress.h"
|
|
|
|
namespace esphome {
|
|
|
|
/// Return whether the node is connected to the network (through wifi, eth, ...)
|
|
bool network_is_connected();
|
|
/// Get the active network hostname
|
|
std::string network_get_address();
|
|
|
|
/// Return whether the node has at least one client connected to the native API
|
|
bool api_is_connected();
|
|
|
|
/// Return whether the node has an active connection to an MQTT broker
|
|
bool mqtt_is_connected();
|
|
|
|
/// Return whether the node has any form of "remote" connection via the API or to an MQTT broker
|
|
bool remote_is_connected();
|
|
|
|
/// Manually set up the network stack (outside of the App.setup() loop, for example in OTA safe mode)
|
|
#ifdef ARDUINO_ARCH_ESP8266
|
|
void network_setup_mdns(const IPAddress &address, int interface);
|
|
#endif
|
|
#ifdef ARDUINO_ARCH_ESP32
|
|
void network_setup_mdns();
|
|
#endif
|
|
|
|
void network_tick_mdns();
|
|
|
|
} // namespace esphome
|