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:
Sam Lewis
2022-10-09 16:28:42 -04:00
parent 889d7ab993
commit bdc5e9295d
11 changed files with 428 additions and 83 deletions
+23
View File
@@ -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
// }