diff --git a/code/espurna/system.ino b/code/espurna/system.ino index 27b2d4dd..791ba99c 100644 --- a/code/espurna/system.ino +++ b/code/espurna/system.ino @@ -86,6 +86,12 @@ void _systemSetupHeartbeat() { _heartbeat_interval = getSetting("hbInterval", HEARTBEAT_INTERVAL).toInt(); } +#if WEB_SUPPORT + bool _systemWebSocketOnReceive(const char * key, JsonVariant& value) { + return (strncmp(key, "hb", 2) == 0); + } +#endif + void systemLoop() { // ------------------------------------------------------------------------- @@ -182,6 +188,10 @@ void systemSetup() { systemCheck(false); #endif + #if WEB_SUPPORT + wsOnReceiveRegister(_systemWebSocketOnReceive); + #endif + // Init device-specific hardware _systemSetupSpecificHardware();