private void Flush() { mLedControl.GreenLedOff(); mLedControl.YellowLedOff(); mLedControl.RedLedOn(); mFlusherMotor.Flush(); SetFlushCountInIoBroker(); mToiletStateMachine.Fire(ToiletEvents.FlushFinished); }
public IActionResult Off([FromBody] string action) { IActionResult result = Ok(); try { switch (action.ToLower()) { case "red": mLedControl.RedLedOff(); break; case "yellow": mLedControl.YellowLedOff(); break; case "green": mLedControl.GreenLedOff(); break; case "all": mLedControl.TurnAllLedsOff(); break; default: result = BadRequest($"led action {action} not known"); break; } } catch (Exception ex) { result = BadRequest(ex); } return(result); }