mirror of
https://github.com/Xevion/go-ha.git
synced 2025-12-10 14:07:26 -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:
11
internal/services/builder.go
Normal file
11
internal/services/builder.go
Normal file
@@ -0,0 +1,11 @@
|
||||
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}
|
||||
}
|
||||
Reference in New Issue
Block a user