🧹 Removes notification event service

This commit is contained in:
Rune Harlyk
2024-05-02 22:29:11 +02:00
committed by Rune Harlyk
parent 9dee0e1bb1
commit b7a4568f07
9 changed files with 59 additions and 139 deletions
+1 -3
View File
@@ -16,7 +16,6 @@
ActuatorStateService::ActuatorStateService(
PsychicHttpServer *server,
NotificationEvents *notificationEvents,
SecurityManager *securityManager
) : _httpEndpoint(
ActuatorState::read,
@@ -33,8 +32,7 @@ ActuatorStateService::ActuatorStateService(
server,
ACTUATOR_SETTINGS_SOCKET_PATH,
securityManager,
AuthenticationPredicates::IS_AUTHENTICATED),
_notificationEvents(notificationEvents)
AuthenticationPredicates::IS_AUTHENTICATED)
{
// Setup actuator hardware
+2 -4
View File
@@ -17,7 +17,6 @@
#include <HttpEndpoint.h>
#include <WebSocketServer.h>
#include <NotificationEvents.h>
#define ACTUATOR_SETTINGS_ENDPOINT_PATH "/rest/actuators"
#define ACTUATOR_SETTINGS_SOCKET_PATH "/ws"
@@ -101,10 +100,9 @@ public:
class ActuatorStateService : public StatefulService<ActuatorState> {
public:
ActuatorStateService(PsychicHttpServer *server, NotificationEvents *notificationEvents, SecurityManager *securityManager);
ActuatorStateService(PsychicHttpServer *server, SecurityManager *securityManager);
void begin();
protected:
NotificationEvents *_notificationEvents;
static void _loopImpl(void *_this) { static_cast<ActuatorStateService *>(_this)->_loop(); }
void _loop()
{
@@ -125,7 +123,7 @@ class ActuatorStateService : public StatefulService<ActuatorState> {
doc["mode"] = (int)_state.motionState;
serializeJson(doc, message);
_notificationEvents->send(message, "motion", millis());
// _notificationEvents->send(message, "motion", millis());
vTaskDelayUntil(&xLastWakeTime, MOTION_INTERVAL / portTICK_PERIOD_MS);
}
};