Closed niels9001 closed 7 years ago
Thanks for the bug report, should be fixed now in version 3.2.4 that's on NuGet.
Thanks that helped! However, it now (for some reason..) sets my Schedule ID to null as well.. Any ideas?
` ToggleSwitch selectedSwitch = sender as ToggleSwitch; Schedule selectedSchedule = selectedSwitch.DataContext as Schedule;
if (selectedSchedule.Status == "enabled")
{
selectedSchedule.Status = "disabled";
}
else
{
selectedSchedule.Status = "enabled";
}
// AT THE SECOND TIME, THE SELECTEDSCHEDULE.ID IS NULL.
await Client.UpdateScheduleAsync(selectedSchedule .Id, selectedSchedule );`
Ok, should be fixed in version 3.2.5 up on NuGet now.
Last update solved this! Thanks!
UpdateScheduleAsync(Schedule S) also wants to update the 'Id' and 'Created' parameters.
Raw JSON:
{ "Id":"1", "name":"sdfsdf", "description":"Floor aan", "command":{ "address":"/api/ID/lights/1/state", "method":"PUT", "body":{ "bri":255, "on":true, "transitiontime":0 } }, "localtime":"W20/T10:45:00", "created":"2016-11-04T09:45:50", "status":"disabled" }
Results in:
[ { "error": { "type": 6, "address": "/schedules/1/Id", "description": "parameter, Id, not available" } }, { "error": { "type": 6, "address": "/schedules/1/created", "description": "parameter, created, not available" } } ]
Leaving out Id and created solves the issue!