mirror of
https://github.com/alexhopeoconnor/WiFiManager.git
synced 2026-10-04 02:48:13 +10:00
Improve portal content documentation
This commit is contained in:
@@ -8,14 +8,24 @@ void setup() {
|
||||
Serial.begin(115200);
|
||||
|
||||
portal.portalAddParameter(&brokerHost);
|
||||
portal.portalAddInfoSection({
|
||||
"device", "Example device",
|
||||
{{"firmware", "Firmware", "1.0.0"}, {"sensor", "Sensor", "Ready"}},
|
||||
});
|
||||
portal.portalAddHomeCard({
|
||||
"hint", "What this example adds", PortalHomeCardKind::Callout,
|
||||
"A normal text setting, a status section, and a home-page callout.", {},
|
||||
});
|
||||
|
||||
// WiFiManager copies this read-only status section when it is registered.
|
||||
PortalInfoSection deviceInfo;
|
||||
deviceInfo.id = "device";
|
||||
deviceInfo.title = "Example device";
|
||||
deviceInfo.items = {
|
||||
{"firmware", "Firmware", "1.0.0"},
|
||||
{"sensor", "Sensor", "Ready"},
|
||||
};
|
||||
portal.portalAddInfoSection(deviceInfo);
|
||||
|
||||
// This callout appears on the built-in portal overview.
|
||||
PortalHomeCard hint;
|
||||
hint.id = "hint";
|
||||
hint.title = "What this example adds";
|
||||
hint.kind = PortalHomeCardKind::Callout;
|
||||
hint.text = "A normal text setting, a status section, and a home-page callout.";
|
||||
portal.portalAddHomeCard(hint);
|
||||
|
||||
portal.setSaveParamsCallback([](WiFiManager::WiFiManagerRequestArgs) {
|
||||
Serial.print("MQTT broker selected: ");
|
||||
|
||||
@@ -10,4 +10,4 @@ It opens **WiFiManager Content** with password **example-pass** until it has wor
|
||||
|
||||
The parameter object is global because WiFiManager reads it for the lifetime of the portal. In a real application, copy the value into that application’s own validated persistent configuration inside the save callback.
|
||||
|
||||
See [Portal UI](../../docs/PORTAL_UI.md) and the shared [example guide](../README.md).
|
||||
See [structured portal content](../../docs/PORTAL_UI.md#structured-portal-content) and the shared [example guide](../README.md).
|
||||
|
||||
+8
-1
@@ -17,6 +17,13 @@ Choose `esp32` for an ESP32 development board. The examples use the checked-out
|
||||
| [Branded Portal](BrandedPortal/) | change the portal’s identity, logo, and semantic visual theme |
|
||||
| [Station Profiles](StationProfiles/) | remember a primary Wi-Fi network and one fallback in application-owned EEPROM storage |
|
||||
|
||||
The portal examples intentionally begin with no station credentials. On first boot, connect to the access point printed on serial and open `http://192.168.4.1/`.
|
||||
The portal examples intentionally begin with no station credentials. On first boot, connect to the matching setup network and open `http://192.168.4.1/`.
|
||||
|
||||
| Example | Setup network | Password |
|
||||
| --- | --- | --- |
|
||||
| Basic Portal | WiFiManager Basic | example-pass |
|
||||
| Custom Portal Content | WiFiManager Content | example-pass |
|
||||
| Branded Portal | Temperature Monitor | none |
|
||||
| Station Profiles | WiFiManager Profiles | example-pass |
|
||||
|
||||
Back to the [project overview](../README.md).
|
||||
|
||||
Reference in New Issue
Block a user