add webserver with API for controlling commands
This commit is contained in:
parent
57c6051f7d
commit
74ff694293
@ -23,7 +23,8 @@ lib_deps =
|
|||||||
sparkfun/SparkFun BME280@^2.0.9
|
sparkfun/SparkFun BME280@^2.0.9
|
||||||
arkhipenko/TaskScheduler@^3.8.5
|
arkhipenko/TaskScheduler@^3.8.5
|
||||||
https://git.hodos.ro/libraries/wifi.git@^2.0.0
|
https://git.hodos.ro/libraries/wifi.git@^2.0.0
|
||||||
https://git.hodos.ro/libraries/ha-mqtt.git@^1.7.0
|
https://git.hodos.ro/libraries/ha-mqtt.git@^1.8.0
|
||||||
|
https://git.hodos.ro/libraries/ha-webserver.git@^1.0.0
|
||||||
build_flags = -D WIFI_ALWAYS_ON=1 -D ADAFRUIT_BME=1
|
build_flags = -D WIFI_ALWAYS_ON=1 -D ADAFRUIT_BME=1
|
||||||
|
|
||||||
[env:laptop_home]
|
[env:laptop_home]
|
||||||
|
|||||||
@ -23,6 +23,7 @@ void turnLed(bool on = true) {
|
|||||||
#include "devices.h"
|
#include "devices.h"
|
||||||
#include "mqtt.h"
|
#include "mqtt.h"
|
||||||
#include "ota.h"
|
#include "ota.h"
|
||||||
|
#include "webserver.h"
|
||||||
|
|
||||||
#define BUTTON D3
|
#define BUTTON D3
|
||||||
|
|
||||||
@ -63,6 +64,7 @@ void setup() {
|
|||||||
Mqtt::publishCleanupConfig();
|
Mqtt::publishCleanupConfig();
|
||||||
delay(2000);
|
delay(2000);
|
||||||
Mqtt::disconnect();
|
Mqtt::disconnect();
|
||||||
|
WebServer::stop();
|
||||||
});
|
});
|
||||||
Ntp::setup();
|
Ntp::setup();
|
||||||
Bme::setup();
|
Bme::setup();
|
||||||
@ -77,10 +79,12 @@ void setup() {
|
|||||||
Ota::tLoop.enable();
|
Ota::tLoop.enable();
|
||||||
Mqtt::tReConnect.enable();
|
Mqtt::tReConnect.enable();
|
||||||
Ntp::tUpdateTime.enable();
|
Ntp::tUpdateTime.enable();
|
||||||
|
WebServer::setup();
|
||||||
},
|
},
|
||||||
[] {
|
[] {
|
||||||
Ota::tLoop.disable();
|
Ota::tLoop.disable();
|
||||||
Mqtt::tReConnect.disable();
|
Mqtt::tReConnect.disable();
|
||||||
|
WebServer::stop();
|
||||||
});
|
});
|
||||||
|
|
||||||
pinMode(BUTTON, INPUT_PULLUP);
|
pinMode(BUTTON, INPUT_PULLUP);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user