mirror of
https://github.com/iminet/dev.git
synced 2025-04-20 20:25:47 +02:00
Improvements
This commit is contained in:
parent
0712b5431a
commit
920e9fa11e
@ -1,4 +1,4 @@
|
|||||||
using SmartThingsNet.Api;
|
using SmartThingsNet.Api;
|
||||||
using SmartThingsNet.Client;
|
using SmartThingsNet.Client;
|
||||||
using SmartThingsNet.Model;
|
using SmartThingsNet.Model;
|
||||||
|
|
||||||
@ -16,9 +16,17 @@ namespace SmartThings
|
|||||||
var rooms = new RoomsApi(configuration);
|
var rooms = new RoomsApi(configuration);
|
||||||
var devicelist = devices.GetDevices(accesstoken).Items;
|
var devicelist = devices.GetDevices(accesstoken).Items;
|
||||||
|
|
||||||
Console.WriteLine(String.Join(Environment.NewLine, locations.ListLocations(accesstoken).Items.Select(x => x.Name)));
|
Console.WriteLine("Locations:");
|
||||||
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+"- ", locations.ListLocations(accesstoken).Items.Select(x => x.Name)));
|
||||||
Console.WriteLine(String.Join(Environment.NewLine, devicelist.Select(x => $"{x.Label} :: {x.DeviceId}").ToList()));
|
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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user