public ActuatorHistory(IActuator actuator, IHttpRequestController apiRequestController, ILogger logger) { _actuator = actuator; _logger = logger; _filename = Path.Combine(ApplicationData.Current.LocalFolder.Path, "Actuators", actuator.Id.Value, "History.csv"); apiRequestController.HandleGet($"statistics/{actuator.Id}").Using(HandleApiGet); }
public void ExposeToApi(IHttpRequestController httpApiController) { if (httpApiController == null) { throw new ArgumentNullException(nameof(httpApiController)); } httpApiController.HandleGet("trace").Using(HandleApiGet); }
public HealthMonitor(IBinaryOutput statusLed, IHomeAutomationTimer timer, IHttpRequestController httpApiController) { if (timer == null) { throw new ArgumentNullException(nameof(timer)); } if (httpApiController == null) { throw new ArgumentNullException(nameof(httpApiController)); } _statusLed = statusLed; _timer = timer; _startedDate = _timer.CurrentDateTime; if (statusLed != null) { _ledTimeout.Start(TimeSpan.FromMilliseconds(1)); } timer.Tick += Tick; httpApiController.HandleGet("health").Using(HandleApiGet); httpApiController.HandlePost("health/reset").Using(c => ResetStatistics()); }
public void ExposeToApi() { _httpApiController.HandlePost($"{_relativeUri}/settings").Using(HandleApiPost); _httpApiController.HandleGet($"{_relativeUri}/settings").Using(HandleApiGet); }
public void ExposeToApi() { _httpApiController.HandleGet("weatherStation").Using(HandleApiGet); _httpApiController.HandlePost("weatherStation").Using(HandleApiPost); }
private void ExposeToApi() { _httpApi.HandleGet($"device/{Id}").Using(HandleApiGet); _httpApi.HandlePost($"device/{Id}").Using(HandleApiPost); _httpApi.HandlePatch($"device/{Id}").Using(HandleApiPatch); }