mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-06 01:15:10 -06:00
22 lines
561 B
Go
22 lines
561 B
Go
package gomeassistant
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/saml-dev/gome-assistant/internal/http"
|
|
"github.com/saml-dev/gome-assistant/internal/services"
|
|
"nhooyr.io/websocket"
|
|
)
|
|
|
|
type Service struct {
|
|
HomeAssistant *services.HomeAssistant
|
|
Light *services.Light
|
|
}
|
|
|
|
func NewService(conn *websocket.Conn, ctx context.Context, httpClient *http.HttpClient) *Service {
|
|
return &Service{
|
|
Light: services.BuildService[services.Light](conn, ctx, httpClient),
|
|
HomeAssistant: services.BuildService[services.HomeAssistant](conn, ctx, httpClient),
|
|
}
|
|
}
|