michielpost / Q42.HueApi

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

Activating scene in Clip V2 API #290

Closed JOHNEPPILLAR closed 1 year ago

JOHNEPPILLAR commented 1 year ago

Question:

How do you activate a scene using the Clip v2 API?

In the v1 API, I know you can activate a scene by using:

var command = new SceneCommand {Scene = "xxxxxxxx"} await _client.SendGroupCommandAsync(command, groupId)

michielpost commented 1 year ago

You can do this:

UpdateScene req = new UpdateScene()
{
  Recall = new Recall() {  Action = "active"}
};
var result = await localHueClient.UpdateSceneAsync(id, req);

In the next update this will be made more typesafe:

Recall = new Recall() {  Action =  SceneRecallAction.active }

You can use the Hue Migration Guide to see how things work with the V2 API: https://developers.meethue.com/develop/hue-api-v2/migration-guide-to-the-new-hue-api/#Scenes

JOHNEPPILLAR commented 1 year ago

You can do this:

UpdateScene req = new UpdateScene()
{
  Recall = new Recall() {  Action = "active"}
};
var result = await localHueClient.UpdateSceneAsync(id, req);

In the next update this will be made more typesafe:

Recall = new Recall() {  Action =  SceneRecallAction.active }

You can use the Hue Migration Guide to see how things work with the V2 API: https://developers.meethue.com/develop/hue-api-v2/migration-guide-to-the-new-hue-api/#Scenes

Thank you very much. Appreciated.