mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
cleanup
This commit is contained in:
@@ -1,20 +0,0 @@
|
|||||||
#include <EMSESPScanDevicesService.h>
|
|
||||||
|
|
||||||
#include "emsesp.h"
|
|
||||||
|
|
||||||
namespace emsesp {
|
|
||||||
|
|
||||||
EMSESPScanDevicesService::EMSESPScanDevicesService(AsyncWebServer * server, SecurityManager * securityManager) {
|
|
||||||
server->on(SCAN_DEVICES_SERVICE_PATH,
|
|
||||||
HTTP_POST,
|
|
||||||
securityManager->wrapRequest(std::bind(&EMSESPScanDevicesService::scan_devices, this, std::placeholders::_1), AuthenticationPredicates::IS_ADMIN));
|
|
||||||
}
|
|
||||||
|
|
||||||
void EMSESPScanDevicesService::scan_devices(AsyncWebServerRequest * request) {
|
|
||||||
request->onDisconnect([]() {
|
|
||||||
EMSESP::send_read_request(EMSdevice::EMS_TYPE_UBADevices, EMSdevice::EMS_DEVICE_ID_BOILER);
|
|
||||||
});
|
|
||||||
request->send(200);
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace emsesp
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
#ifndef EMSESPScanDevicesService_h
|
|
||||||
#define EMSESPScanDevicesService_h
|
|
||||||
|
|
||||||
#include <ESPAsyncWebServer.h>
|
|
||||||
#include <SecurityManager.h>
|
|
||||||
|
|
||||||
#define SCAN_DEVICES_SERVICE_PATH "/rest/scanDevices"
|
|
||||||
|
|
||||||
namespace emsesp {
|
|
||||||
|
|
||||||
class EMSESPScanDevicesService {
|
|
||||||
public:
|
|
||||||
EMSESPScanDevicesService(AsyncWebServer * server, SecurityManager * securityManager);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void scan_devices(AsyncWebServerRequest * request);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace emsesp
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -17,6 +17,7 @@
|
|||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(EMSESP_STANADLONE)
|
||||||
|
|
||||||
#include "test.h"
|
#include "test.h"
|
||||||
|
|
||||||
@@ -692,3 +693,5 @@ void Test::dummy_mqtt_commands(const char * message) {
|
|||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
|
|
||||||
} // namespace emsesp
|
} // namespace emsesp
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user