Send power events in a more usable format
This commit is contained in:
parent
49f3a61d16
commit
9830387f21
|
@ -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
|
||||
}
|
||||
|
|
|
@ -13,8 +13,9 @@ import (
|
|||
type Event string
|
||||
type ActivityMeta map[string]interface{}
|
||||
|
||||
const ActivityPowerPrefix = "power_"
|
||||
|
||||
const (
|
||||
ActivityPower = Event("power")
|
||||
ActivityConsoleCommand = Event("console_command")
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user