public async Task <EnvironmentMonitorSensorReading> GetSensor(string sensorip, string sensorname) { EnvironmentMonitorReading reading = await _service.GetReading($"http://{sensorip}/");; foreach (EnvironmentMonitorSensorReading sensor in reading.Sensors) { if (sensor.Name.Equals(sensorname, StringComparison.InvariantCultureIgnoreCase)) { return(sensor); } } return(new EnvironmentMonitorSensorReading()); }
public async Task <EnvironmentMonitorSystem> GetSystem(string sensorip) { EnvironmentMonitorReading reading = await _service.GetReading($"http://{sensorip}/");; return(reading.System); }