mirror of
https://github.com/Xevion/go-ha.git
synced 2026-01-31 02:24:26 -06:00
figured out how to get conn/ctx into users method calls - by passing a configured service object to their callback functions
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
package gomeassistant
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/saml-dev/gome-assistant/internal/services"
|
||||
"nhooyr.io/websocket"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
HomeAssistant homeAssistant
|
||||
Light services.Light
|
||||
}
|
||||
|
||||
type homeAssistant struct {
|
||||
conn websocket.Conn
|
||||
ctx context.Context
|
||||
}
|
||||
|
||||
// type light struct {
|
||||
// conn websocket.Conn
|
||||
// ctx context.Context
|
||||
// }
|
||||
Reference in New Issue
Block a user