Improvements

This commit is contained in:
Imi 2022-08-29 11:29:17 +02:00 committed by GitHub
parent 0712b5431a
commit 920e9fa11e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();
}
}
}
}