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
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
_ = h.ra.Save(h.server, server.ActivityPower, server.ActivityMeta{
|
if err == nil {
|
||||||
"signal": string(action),
|
_ = h.ra.Save(h.server, server.Event(server.ActivityPowerPrefix+action), nil)
|
||||||
})
|
}
|
||||||
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,8 +13,9 @@ import (
|
||||||
type Event string
|
type Event string
|
||||||
type ActivityMeta map[string]interface{}
|
type ActivityMeta map[string]interface{}
|
||||||
|
|
||||||
|
const ActivityPowerPrefix = "power_"
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ActivityPower = Event("power")
|
|
||||||
ActivityConsoleCommand = Event("console_command")
|
ActivityConsoleCommand = Event("console_command")
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user