diff options
author | Christian Brunner <chb@muc.de> | 2016-09-13 22:31:07 +0200 |
---|---|---|
committer | Christian Brunner <chb@muc.de> | 2016-09-15 17:56:45 +0200 |
commit | 717f77eeb3be68ba8328e04f90904070df687d3d (patch) | |
tree | 0943188ca8ddc1d451a5f2dda4f25175ae5f026f | |
parent | de4b7f2603270cdf868e22245924cb51afd57934 (diff) |
add RecallSceneByName()
-rw-r--r-- | scene.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -94,6 +94,15 @@ func (bridge *Bridge) RecallScene(id string) error { return bridge.SetGroupState(0, action) } +// Bridge.RecallSceneByName recalls a scene +func (bridge *Bridge) RecallSceneByName(name string) error { + scene, err := bridge.GetSceneByName(name) + if err != nil { + return err + } + return bridge.RecallScene(scene.ID) +} + // Bridge.CreateScene posts a new scene configuration to the bridge. func (bridge *Bridge) CreateScene(scene Scene) error { uri := fmt.Sprintf("/api/%s/scenes/", bridge.Username) |