You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
826 B

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. package events
  2. import (
  3. "fmt"
  4. "git.aiterp.net/lucifer3/server/device"
  5. )
  6. type HardwareState struct {
  7. ID string `json:"internalId"`
  8. InternalName string `json:"internalName"`
  9. SupportFlags device.SupportFlags `json:"deviceFlags"`
  10. ColorFlags device.ColorFlag `json:"colorFlags"`
  11. Buttons []string `json:"buttons"`
  12. State device.State `json:"state"`
  13. }
  14. func (d HardwareState) EventDescription() string {
  15. return fmt.Sprintf("HardwareState(id:%s, iname:%#+v, sflags:%s, cflags:%s, buttons:%v, state:%s)",
  16. d.ID, d.InternalName, d.SupportFlags, d.ColorFlags, d.Buttons, d.State,
  17. )
  18. }
  19. type Unreachable struct {
  20. DeviceID string `json:"deviceId"`
  21. }
  22. func (d Unreachable) EventDescription() string {
  23. return fmt.Sprintf("Unreachable(id:%s)", d.DeviceID)
  24. }