DEV_Valve.h
/* Called by Home Space when Home Kit changes something */
Called by Home Space when Home Kit changes something
Called by Home Space when Home Kit changes something
boolean update(void) {
    Serial.print(nameptr);
    Serial.print(": update, active: ");
    Serial.print(active->getNewVal());
    Serial.print(" inUse: ");
    Serial.print(inUse->getNewVal());
    Serial.print(" valveType: ");
    Serial.print(valveType->getNewVal());
    Serial.print(" setDuration: ");
    Serial.println(setDuration->getNewVal());
    if (active->getNewVal() && !on)
      turnOn();
    if (!active->getNewVal() && on)
      turnOff();
    return(true);
  }
boolean update ( void ) { Serial . print ( nameptr ) ; Serial . print ( " " ) ; Serial . print ( active -> getNewVal ( ) ) ; Serial . print ( " " ) ; Serial . print ( inUse -> getNewVal ( ) ) ; Serial . print ( " " ) ; Serial . print ( valveType -> getNewVal ( ) ) ; Serial . print ( " " ) ; Serial . println ( setDuration -> getNewVal ( ) ) ; if ( active -> getNewVal ( ) && ! on ) turnOn ( ) ; if ( ! active -> getNewVal ( ) && on ) turnOff ( ) ; return ( true ) ; }
Called by Home Space when Home Kit changes something
Called by Home Space when Home Kit changes something
/* Handle turn on/off as required */