modulepackage
0.0.0-20231017164428-6cf00e0e1c99
Repository: https://github.com/nipsufn/wizz.git
Documentation: pkg.go.dev
# README
wizz
Phillips Wizz Local Connection, see main.go for detail example.
Install package go get github.com/FerdinaKusumah/wizz
Available methods
getState
get current state bulbgetConfig
get current configturnOnLight
turn on light bulbturnOffLight
turn off light bulbsetColorTemp
set bulb color temperaturesetBrightness
set brightness light bulbsetColorRGB
set RGB color light bulbsetColorScene
set color scheme based on available schemesetColorWarmWhite
set color warm light bulbsetColorColdWhite
set color cold light bulb
Reference project from https://github.com/sbidy/wiz_light
Example
package main
import (
"encoding/json"
"fmt"
phillipWhizz "github.com/FerdinaKusumah/wizz"
responseModel "github.com/FerdinaKusumah/wizz/models"
"log"
)
func main() {
var (
bulbIp = "192.168.1.10"
response = new(responseModel.ResponsePayload)
result []byte
err error
)
//--------- Example Get Bulb Config -----------
if response, err = phillipWhizz.GetConfig(bulbIp); err != nil {
log.Errorf(`Unable to read response: %s`, err)
}
if result, err = json.Marshal(response); err != nil {
log.Errorf(`Unable to convert to json string: %s`, err)
}
fmt.Println(string(result))
// --------- Example Turn Off light -----------
if response, err = phillipWhizz.TurnOffLight(bulbIp); err != nil {
log.Errorf(`Unable to read response: %s`, err)
}
if result, err = json.Marshal(response); err != nil {
log.Errorf(`Unable to convert to json string: %s`, err)
}
fmt.Println(string(result))
...
}
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author