Files
Server/events/device.go
T
2022-08-15 19:45:26 +02:00

30 lines
826 B
Go

package events
import (
"fmt"
"git.aiterp.net/lucifer3/server/device"
)
type HardwareState struct {
ID string `json:"internalId"`
InternalName string `json:"internalName"`
SupportFlags device.SupportFlags `json:"deviceFlags"`
ColorFlags device.ColorFlag `json:"colorFlags"`
Buttons []string `json:"buttons"`
State device.State `json:"state"`
}
func (d HardwareState) EventDescription() string {
return fmt.Sprintf("HardwareState(id:%s, iname:%#+v, sflags:%s, cflags:%s, buttons:%v, state:%s)",
d.ID, d.InternalName, d.SupportFlags, d.ColorFlags, d.Buttons, d.State,
)
}
type Unreachable struct {
DeviceID string `json:"deviceId"`
}
func (d Unreachable) EventDescription() string {
return fmt.Sprintf("Unreachable(id:%s)", d.DeviceID)
}