Browse Source

Check current domoticz status to avoid (un)subscribe with every update from the webUI

i18n
Xose Pérez 6 years ago
parent
commit
c734158d1c
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      code/espurna/domoticz.ino

+ 3
- 2
code/espurna/domoticz.ino View File

@ -104,8 +104,9 @@ void _domoticzWebSocketOnSend(JsonObject& root) {
#endif // WEB_SUPPORT
void _domoticzConfigure() {
_dcz_enabled = getSetting("dczEnabled", DOMOTICZ_ENABLED).toInt() == 1;
_domoticzMqttSubscribe(_dcz_enabled);
bool enabled = getSetting("dczEnabled", DOMOTICZ_ENABLED).toInt() == 1;
if (enabled != _dcz_enabled) _domoticzMqttSubscribe(enabled);
_dcz_enabled = enabled;
}
//------------------------------------------------------------------------------


Loading…
Cancel
Save