Exemplo n.º 1
0
        private async Task GetSensorLogs(string start, string end, string id = null)
        {
            try {
                ICollection <SensorLog> sensorLogs;
                if (id == null)
                {
                    WriteLine($"Testing GET \"{Route}{SensorLogs.Route}/{start}/{end}\"");
                    sensorLogs = await SensorLogs.GetSensorLogs(start, end);
                }
                else
                {
                    WriteLine($"Testing GET \"{Route}{Sensors.Route}/{id}{SensorLogs.Route}/{start}/{end}\"");
                    sensorLogs = await Sensors.GetSensorLogs(start, end, id);
                }

                WriteLine($"Got {sensorLogs.Count} Sensor Logs:");
                foreach (SensorLog sensorLog in sensorLogs)
                {
                    WriteLine(sensorLog.GetPrintString());
                }
                WriteLine();
            } catch (Exception ex) {
                WriteLine($"Method Error: {ex.Message}\n");
            }
        }