Ejemplo n.º 1
0
        public async Task CreateScheduleSingle()
        {
            Schedule schedule = new Schedule();

            schedule.Name               = "t1";
            schedule.Description        = "test";
            schedule.Time               = DateTime.Now.AddDays(1);
            schedule.Command            = new ScheduleCommand();
            schedule.Command.Body       = new LightCommand();
            schedule.Command.Body.Alert = Alert.Once;
            schedule.Command.Address    = "/api/huelandspoor/lights/5/state";
            schedule.Command.Method     = "PUT";

            var result = await _client.CreateScheduleAsync(schedule);

            Assert.IsNotNull(result);
        }
Ejemplo n.º 2
0
        public async Task CreateScheduleSingle()
        {
            Schedule schedule = new Schedule();

            schedule.Name        = "t1";
            schedule.Description = "test";
            schedule.LocalTime   = new HueDateTime()
            {
                DateTime = DateTime.Now.AddDays(1)
            };
            schedule.Command = new InternalBridgeCommand();

            var commandBody = new LightCommand();

            commandBody.Alert        = Alert.Once;
            schedule.Command.Body    = commandBody;
            schedule.Command.Address = "/api/huelandspoor/lights/5/state";
            schedule.Command.Method  = HttpMethod.Put;

            var result = await _client.CreateScheduleAsync(schedule);

            Assert.IsNotNull(result);
        }
Ejemplo n.º 3
0
        public async Task CreateScheduleSingle()
        {
            Schedule schedule = new Schedule();

            schedule.Name        = "t1";
            schedule.Description = "test";
            schedule.LocalTime   = new HueDateTime()
            {
                TimerTime    = TimeSpan.FromHours(10),
                RecurringDay = RecurringDay.RecurringMonday | RecurringDay.RecurringThursday
            };
            schedule.Command = new InternalBridgeCommand();

            var commandBody = new LightCommand();

            commandBody.Alert        = Alert.Once;
            schedule.Command.Body    = commandBody;
            schedule.Command.Address = "/api/huelandspoor/lights/5/state";
            schedule.Command.Method  = HttpMethod.Put;

            var result = await _client.CreateScheduleAsync(schedule);

            Assert.IsNotNull(result);
        }