 
   // valve demo mode TODO remove?
   if (GOT_TEMP_SENSOR==FALSE) {
-    valveStateChange(1, TRUE, P1_MCP_PIN, S1_MCP_PIN);
+    flowController.valves[0].on();
     delay(15000);
-    valveStateChange(1, FALSE, P1_MCP_PIN, S1_MCP_PIN);
+    flowController.valves[0].off();
     delay(5000);
   }
 

  bool gotOverflow = false;         // does the growbed have an overflow?
  char fillLevel = 5;               // cms below the level sensor: drain point

  public:
  void step(monitor_t* now) {       // check conditions and adjust state
  }
};
class FlowController { // the set of valves and their config ////////////////
  int numValves = 3;                // WARNING! call init if resetting!
  char cycleMinutes = 60;           // how long is a flood/drain cycle?
  char maxSimultaneousDrainers = 1; // how many beds can drain simultaneously

#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include "./DNSServer.h"      // patched lib
#include <FS.h>
#include <OneWire.h>
#include <DallasTemperature.h>
