public async Task <List <PowerStrip> > GetAllStrips() { MqttService.MqttService lService = await GetMqttService(); List <PowerStrip> result = lService.GetPowerStrips().ToList(); return(result); }
public async Task <IHttpActionResult> GetStrip(string id) { MqttService.MqttService lService = await GetMqttService(); var strips = lService.GetPowerStrips().ToList(); var strip = strips.FirstOrDefault((p) => p.DeviceId == id); if (strip == null) { return(NotFound()); } return(Ok(strip)); }