diff options
-rw-r--r-- | bridge.go | 3 | ||||
-rw-r--r-- | light.go | 2 |
2 files changed, 5 insertions, 0 deletions
@@ -80,6 +80,8 @@ func (self *Bridge) Post(path string, params interface{}) ([]byte, io.Reader, er return handleResponse(resp) } +// Bridge.Put will send an http PUT to the bridge with +// a body formatted with parameters (in a generic interface) func (self *Bridge) Put(path string, params interface{}) ([]byte, io.Reader, error) { uri := fmt.Sprintf("http://" + self.IPAddress + path) client := &http.Client{} @@ -99,6 +101,7 @@ func (self *Bridge) Put(path string, params interface{}) ([]byte, io.Reader, err return handleResponse(resp) } +// Bridge.Delete will send an http DELETE to the bridge func (self *Bridge) Delete(path string) error { uri := fmt.Sprintf("http://" + self.IPAddress + path) client := &http.Client{} @@ -90,6 +90,8 @@ func (self *Light) Toggle() error { return nil } +// Light.Delete will remove the light from the list of +// lights available on the bridge. func (self *Light) Delete() error { uri := fmt.Sprintf("/api/%s/lights/%d", self.Bridge.Username, self.Index) err := self.Bridge.Delete(uri) |