mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-10 04:07:28 -06:00
- 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
12 lines
191 B
Go
12 lines
191 B
Go
package services
|
|
|
|
import (
|
|
"context"
|
|
|
|
"nhooyr.io/websocket"
|
|
)
|
|
|
|
func BuildService[T Light | HomeAssistant](conn *websocket.Conn, ctx context.Context) *T {
|
|
return &T{conn: conn, ctx: ctx}
|
|
}
|