stateful night vision rework

This commit is contained in:
legop3
2026-01-28 13:45:01 -05:00
parent f3cc73f178
commit 7e850dab22
20 changed files with 384 additions and 176 deletions
+7 -1
View File
@@ -184,7 +184,13 @@ func (c *WSClient) dispatch(ctx context.Context, msg *inboundMessage) error {
if c.nightVision == nil {
return fmt.Errorf("night vision disabled")
}
return c.nightVision.HandleAction(msg.NightVision.Action)
if err := c.nightVision.HandleAction(msg.NightVision.Action); err != nil {
return err
}
c.emitEvent("nightVision.state", map[string]any{
"nightVisionOn": c.nightVision.NightVisionOn(),
})
return nil
case msg.Song != nil:
slot := 0
if msg.Song.Slot != nil {