mirror of
https://github.com/esphome/esphome-docs.git
synced 2024-11-16 10:55:21 +01:00
38 lines
720 B
ReStructuredText
38 lines
720 B
ReStructuredText
WiFi
|
|
====
|
|
|
|
Example Usage
|
|
-------------
|
|
|
|
.. code-block:: cpp
|
|
|
|
// Basic
|
|
App.init_wifi("YOUR_SSID", "YOUR_PASSWORD");
|
|
// Manual IP
|
|
auto *wifi = App.init_wifi("YOUR_SSID", "YOUR_PASSWORD");
|
|
wifi->set_sta_manual_ip(ManualIP{
|
|
.static_ip = IPAddress(192, 168, 178, 42),
|
|
.gateway = IPAddress(192, 168, 178, 1),
|
|
.subnet = IPAddress(255, 255, 255, 0)
|
|
});
|
|
// AP
|
|
wifi->set_ap("AP SSID", "Optional AP Password");
|
|
|
|
API Reference
|
|
-------------
|
|
|
|
.. cpp:namespace:: nullptr
|
|
|
|
WiFiComponent
|
|
*************
|
|
|
|
.. doxygenclass:: WiFiComponent
|
|
:members:
|
|
:protected-members:
|
|
:undoc-members:
|
|
|
|
.. doxygenstruct:: ManualIP
|
|
:members:
|
|
:protected-members:
|
|
:undoc-members:
|