Refactors event socket

This commit is contained in:
Rune Harlyk
2024-11-07 16:58:19 +01:00
committed by Rune Harlyk
parent fd652bd967
commit 89611b5e3e
20 changed files with 98 additions and 127 deletions
+2 -3
View File
@@ -14,8 +14,7 @@
#include <BatteryService.h>
BatteryService::BatteryService(Peripherals *peripherals, EventSocket *socket)
: _peripherals(peripherals), _socket(socket) {}
BatteryService::BatteryService(Peripherals *peripherals) : _peripherals(peripherals) {}
void BatteryService::begin() {}
@@ -25,5 +24,5 @@ void BatteryService::batteryEvent() {
doc["voltage"] = _voltage;
doc["current"] = _current;
serializeJson(doc, message);
_socket->emit(EVENT_BATTERY, message);
socket.emit(EVENT_BATTERY, message);
}