Is a simple API client to interact with Home Assistant instance (https://www.home-assistant.io/) via HTTP(s) / Websocket, written in Go
- v0.0.1-dev First public release on May 6, 2020
- Simple and chainable methods for settings and request
# Go Modules
require github.com/alex-savin/hassky
The following samples will assist you to become as comfortable as possible with hassky library.
// Import hassky into your code and refer it as `hassky`.
import "github.com/alex-savin/hassky"
// Create a Hassky Client
h, _ := hassky.New("[HASS-IP-ADDESS]:[PORT]", "[HASS-API-TOKEN]", "[USE-SSL]", "[LOG-LEVEL]")
h.R().Ping().
Exec()
h.R().CallService("light.toggle", "light.porch_01").
Exec()
h.R().CallService("light.toggle", "light.porch_01").
SetParameters(map[string]interface{}{
"transition":15,
"brightness_pct":100
}).
Exec()