Exemplo n.º 1
0
        public async Task <HueGroup> GetGroup(string id, CancellationToken cancellationToken)
        {
            Group?group = await _hueClient.GetGroupAsync(id);

            if (group == null)
            {
                throw new NotFoundException(id);
            }

            return(GroupMapper.Map(group));
        }
Exemplo n.º 2
0
        public async Task CreateGroup()
        {
            //make sure you have lights 1 and 2 in your HUE environment
            List <string> lights = new List <string>()
            {
                "1", "2"
            };

            string groupId = await _client.CreateGroupAsync(lights);

            Assert.IsFalse(string.IsNullOrEmpty(groupId));

            //Get group and check lights
            var group = await _client.GetGroupAsync(groupId);

            await _client.DeleteGroupAsync(groupId);

            Assert.IsTrue(group.Lights.Any());
            Assert.AreEqual <int>(lights.Count, group.Lights.Count, "Should have the same number of lights");
        }