michielpost / Q42.HueApi

C# helper library to talk to the Philips Hue bridge
MIT License
409 stars 114 forks source link

Request: add StoreLightState as action #86

Closed niels9001 closed 7 years ago

niels9001 commented 7 years ago

I'm trying to set the following in a Rule:

"address": "/scenes/8mibZqD7HOsWpn4", "method": "PUT", "body": { "storelightstate": true }

E.g.: new InternalBridgeCommand() { Address = "/scenes/8mibZqD7HOsWpn4", Body = new Scene() { StoreLightState = true }, Method = HttpMethod.Put })

michielpost commented 7 years ago

Ok, I've added it, not sure if it will work?

If you want to have full control over your commands, you can use the GenericScheduleCommand:


dynamic dynamicCommand = new ExpandoObject();
dynamicCommand.storelightstate= true;
var jsonString = JsonConvert.SerializeObject(dynamicCommand);
var commandBody = new GenericScheduleCommand(jsonString);```

And then set this commandBody as the Body of the InternalBridgeCommand.
michielpost commented 7 years ago

SceneCommand now has a StoreLightState property. In NuGet release 3.2.6