code: function updatePhase(self, value) {
          var cycle = self.cycles[self.cycle];
          self._state.countdown = 0;
          if (!cycle) {
              winston.info(`updatePhase no cycle`);
              return;
          }
          if (!self.isActive) {
              winston.info(`updatePhase inactive`);
              return;
          }
          winston.debug(`updatePhase vessel:${self.name} mist:${value}`);
          if (value) {
              if (!self.maxCycles || self._state.cycleNumber <= self.maxCycles) {
                  self._state.cycleNumber++;
              }
              if (self.maxCycles && self._state.cycleNumber > self.maxCycles) {
                  self.activate(false);
              } else { 
                  self._state.countdown = Math.trunc(cycle.on);
                  self._state.countstart = self._state.countdown;
                  self.emitter.emit(OyaMist.EVENT_MIST, value);
                  var msOn = Number(cycle.on) * 1000;
                  if (msOn > 0) {
                      self._phaseTimeout = setTimeout(() => {
                          self._phaseTimeout = null;
                          updatePhase(self, false);
                      }, msOn);
                  }
              }
          } else {
              self._state.countdown = Math.trunc(cycle.off);
              self._state.countstart = self._state.countdown;
              self.emitter.emit(OyaMist.EVENT_MIST, value);
              if (OyaVessel.DEFAULT_CYCLES[cycle.off]) {
                  self.setCycle(cycle.off);
              } else {
                  var msOff = Math.max(0,Number(cycle.off) * 1000);
                  self._phaseTimeout = setTimeout(() => {
                      self._phaseTimeout = null;
                      if (self.cycle === self.nextCycle) {
                          updatePhase(self, true);
                      } else {
                          self.setCycle(self.nextCycle);
                      }
                  }, msOff);
              }
          }
      }
docs: // class OyaVessel