Bridge events
This commit is contained in:
@@ -195,9 +195,9 @@ func (b *bridge) Run(ctx context.Context, info models.Bridge, ch chan<- models.E
|
||||
defer conn.Close()
|
||||
|
||||
// Notify connections and disconnections
|
||||
ch <- models.Event{Name: "BridgeConnected", Payload: map[string]string{"bridgeId": strconv.Itoa(info.ID)}}
|
||||
ch <- models.BridgeConnectedEvent(info)
|
||||
defer func() {
|
||||
ch <- models.Event{Name: "BridgeDisconnected", Payload: map[string]string{"bridgeId": strconv.Itoa(info.ID)}}
|
||||
ch <- models.BridgeDisconnectedEvent(info)
|
||||
}()
|
||||
|
||||
// Start touch listener. This one should go down together with this one, though, so it needs a new context.
|
||||
|
||||
Reference in New Issue
Block a user