Commit 29ac1bbd authored by Eric Duminil's avatar Eric Duminil
Browse files

Trying to add callbacks

parent 2d458359
......@@ -46,6 +46,26 @@ namespace wifi {
void connect(const char *hostname) {
sensor_console::defineCommand("wifi_scan", scanNetworks, F("(Scans available WiFi networks)"));
sensor_console::defineCommand("local_ip", showLocalIp, F("(Displays local IP and current SSID)"));
sensor_console::defineCommand("wifi_reset", []() {
wifiManager.resetSettings();
}, F("(Resets wifi config)"));
wifiManager.setAPCallback([](WiFiManager *x) {
led_effects::showRainbowWheel();
});
wifiManager.setWebServerCallback([]() {
led_effects::showKITTWheel(color::green);
});
wifiManager.setSaveConfigCallback([]() {
led_effects::showKITTWheel(color::blue);
});
wifiManager.setSaveConfigCallback([]() {
led_effects::showKITTWheel(color::magenta);
});
wifiManager.autoConnect(hostname);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment