public object SetAcMode(int selecteId, AcMode mode) { var result = _client.ConnectAndSend(_atMessages.GetInitMsg()); var parser = new MessageResponseParser(); var at = parser.Parse(result); var ac = at.GetSelectedAircon(); if (ac != null) { result = _client.ConnectAndSend(_atMessages.SetMode(at.SelectedAc, ac.BrandId, (int)mode)); at = parser.Parse(result); } else { throw new Exception("Failed to find selected aircon unit"); } var response = System.Text.Json.JsonSerializer.Serialize <AirTouchSystem>(at, _serializeOptions); Log.ForContext <VzduchDotekController>().Verbose("{@AirTouchSystem}", at); return(Content(response, "application/json")); }
public AcCommand Heat() { _mode = AcMode.Heat; return(this); }
public AcCommand Cold() { _mode = AcMode.Cold; return(this); }