Send power events in a more usable format

This commit is contained in:
DaneEveritt 2022-07-09 16:26:13 -04:00
parent 49f3a61d16
commit 9830387f21
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 5 additions and 4 deletions

View File

@ -368,9 +368,9 @@ func (h *Handler) HandleInbound(ctx context.Context, m Message) error {
return nil
}
_ = h.ra.Save(h.server, server.ActivityPower, server.ActivityMeta{
"signal": string(action),
})
if err == nil {
_ = h.ra.Save(h.server, server.Event(server.ActivityPowerPrefix+action), nil)
}
return err
}

View File

@ -13,8 +13,9 @@ import (
type Event string
type ActivityMeta map[string]interface{}
const ActivityPowerPrefix = "power_"
const (
ActivityPower = Event("power")
ActivityConsoleCommand = Event("console_command")
)