From 920e9fa11eea310b180d15baa4b3f1a848ad777b Mon Sep 17 00:00:00 2001 From: Imi <27138272+iminet@users.noreply.github.com> Date: Mon, 29 Aug 2022 11:29:17 +0200 Subject: [PATCH] Improvements --- csharp/SmartThings/Program.cs | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/csharp/SmartThings/Program.cs b/csharp/SmartThings/Program.cs index 7e9a7cb..467bc42 100644 --- a/csharp/SmartThings/Program.cs +++ b/csharp/SmartThings/Program.cs @@ -1,4 +1,4 @@ -using SmartThingsNet.Api; +using SmartThingsNet.Api; using SmartThingsNet.Client; using SmartThingsNet.Model; @@ -16,9 +16,17 @@ namespace SmartThings var rooms = new RoomsApi(configuration); var devicelist = devices.GetDevices(accesstoken).Items; - Console.WriteLine(String.Join(Environment.NewLine, locations.ListLocations(accesstoken).Items.Select(x => x.Name))); - Console.WriteLine(String.Join(Environment.NewLine, rooms.ListRooms(accesstoken, locations.ListLocations(accesstoken).Items.First().LocationId.ToString()).Items.Select(x => x.Name))); - Console.WriteLine(String.Join(Environment.NewLine, devicelist.Select(x => $"{x.Label} :: {x.DeviceId}").ToList())); + Console.WriteLine("Locations:"); + Console.WriteLine("- " + String.Join(Environment.NewLine+"- ", locations.ListLocations(accesstoken).Items.Select(x => x.Name))); + Console.WriteLine(); + + Console.WriteLine("Rooms:"); + Console.WriteLine("- " + String.Join(Environment.NewLine+"- ", rooms.ListRooms(accesstoken, locations.ListLocations(accesstoken).Items.First().LocationId.ToString()).Items.Select(x => x.Name))); + Console.WriteLine(); + + Console.WriteLine("Devices:"); + Console.WriteLine("- " + String.Join(Environment.NewLine+"- ", devicelist.Select(x => $"{x.Label} :: {x.DeviceId}").ToList())); + Console.WriteLine(); } } -} \ No newline at end of file +}