Browse Source

Merge pull request #1538 from mcspr/web/hb-prefix

Allow saving heartbeat settings from web
sensors
Xose Pérez 5 years ago
committed by GitHub
parent
commit
b032f8cf73
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions
  1. +10
    -0
      code/espurna/system.ino

+ 10
- 0
code/espurna/system.ino View File

@ -86,6 +86,12 @@ void _systemSetupHeartbeat() {
_heartbeat_interval = getSetting("hbInterval", HEARTBEAT_INTERVAL).toInt(); _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() { void systemLoop() {
// ------------------------------------------------------------------------- // -------------------------------------------------------------------------
@ -182,6 +188,10 @@ void systemSetup() {
systemCheck(false); systemCheck(false);
#endif #endif
#if WEB_SUPPORT
wsOnReceiveRegister(_systemWebSocketOnReceive);
#endif
// Init device-specific hardware // Init device-specific hardware
_systemSetupSpecificHardware(); _systemSetupSpecificHardware();


Loading…
Cancel
Save