mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-06 05:15:15 -06:00
good progress yay:
- impl http client - create http client in App() - generic builder for Service.* - set Service on app to pass to callbacks later - impl State - set State on app to pass to callbacks later - change panic to log.Fatalln
This commit is contained in:
18
internal/services/homeassistant.go
Normal file
18
internal/services/homeassistant.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/saml-dev/gome-assistant/internal/http"
|
||||
"nhooyr.io/websocket"
|
||||
)
|
||||
|
||||
type HomeAssistant struct {
|
||||
conn *websocket.Conn
|
||||
ctx context.Context
|
||||
httpClient *http.HttpClient
|
||||
}
|
||||
|
||||
// TODO: design how much reuse I can get between request types. E.g.
|
||||
// only difference between light.turnon and homeassistant.turnon is
|
||||
// domain and extra data
|
||||
Reference in New Issue
Block a user