public LPD433MHzSignalSender(I2CHardwareBridge.I2CHardwareBridge i2CHardwareBridge, byte pin, IHttpRequestController httpApiController) { if (i2CHardwareBridge == null) { throw new ArgumentNullException(nameof(i2CHardwareBridge)); } if (httpApiController == null) { throw new ArgumentNullException(nameof(httpApiController)); } _i2CHardwareBridge = i2CHardwareBridge; _pin = pin; httpApiController.HandlePost("433MHz").Using(ApiPost); }
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); }