refactor: websockets into 'connect' module, rename & adjust generally

This commit is contained in:
2025-08-01 20:34:45 -05:00
parent 102a4e7438
commit 9b8ef545a6
32 changed files with 202 additions and 149 deletions

View File

@@ -8,7 +8,7 @@ import (
"github.com/golang-module/carbon"
"github.com/Xevion/go-ha/internal"
ws "github.com/Xevion/go-ha/internal/websocket"
ws "github.com/Xevion/go-ha/internal/connect"
"github.com/Xevion/go-ha/types"
)
@@ -141,7 +141,7 @@ type BaseEventMsg struct {
}
/* Functions */
func callEventListeners(app *App, msg ws.ChanMsg) {
func callEventListeners(app *App, msg ws.ChannelMessage) {
baseEventMsg := BaseEventMsg{}
_ = json.Unmarshal(msg.Raw, &baseEventMsg)
listeners, ok := app.eventListeners[baseEventMsg.Event.EventType]