Browse Source

Prevent inching when manually switched back

fastled
Xose Pérez 8 years ago
parent
commit
26ae5a4dd4
1 changed files with 6 additions and 3 deletions
  1. +6
    -3
      code/src/relay.ino

+ 6
- 3
code/src/relay.ino View File

@ -71,8 +71,11 @@ void relayInching(unsigned char id) {
if (relayInch == RELAY_INCHING_NONE) return; if (relayInch == RELAY_INCHING_NONE) return;
bool status = relayStatus(id); bool status = relayStatus(id);
if ((relayInch == RELAY_INCHING_ON) & (status)) return;
if ((relayInch == RELAY_INCHING_OFF) & (!status)) return;
bool inchingStatus = (relayInch == RELAY_INCHING_ON);
if (inchingStatus == status) {
inching.detach();
return;
}
inching.attach( inching.attach(
getSetting("relayInchTime", String(RELAY_INCHING_TIME)).toInt(), getSetting("relayInchTime", String(RELAY_INCHING_TIME)).toInt(),
@ -116,7 +119,7 @@ bool relayStatus(unsigned char id, bool status, bool report) {
if (report) relayMQTT(id); if (report) relayMQTT(id);
if (!recursive) relayWS(); if (!recursive) relayWS();
return changed; return changed;
} }
void relaySync(unsigned char id) { void relaySync(unsigned char id) {


Loading…
Cancel
Save