From 717f77eeb3be68ba8328e04f90904070df687d3d Mon Sep 17 00:00:00 2001 From: Christian Brunner Date: Tue, 13 Sep 2016 22:31:07 +0200 Subject: add RecallSceneByName() --- scene.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scene.go b/scene.go index 9339893..e972de7 100644 --- a/scene.go +++ b/scene.go @@ -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) -- cgit v1.2.3