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.

32 lines
721 B

2 years ago
2 years ago
2 years ago
2 years ago
  1. package effects
  2. import (
  3. "fmt"
  4. "git.aiterp.net/lucifer3/server/device"
  5. "git.aiterp.net/lucifer3/server/internal/color"
  6. "time"
  7. )
  8. type Manual struct {
  9. Power *bool `json:"power,omitempty"`
  10. Color *color.Color `json:"color,omitempty"`
  11. Intensity *float64 `json:"intensity,omitempty"`
  12. Temperature *float64 `json:"temperature,omitempty"`
  13. }
  14. func (e Manual) EffectDescription() string {
  15. return fmt.Sprintf("Manual%s", e.State(0, 0, 0).String())
  16. }
  17. func (e Manual) Frequency() time.Duration {
  18. return 0
  19. }
  20. func (e Manual) State(int, int, int) device.State {
  21. return device.State{
  22. Power: e.Power,
  23. Temperature: e.Temperature,
  24. Intensity: e.Intensity,
  25. Color: e.Color,
  26. }
  27. }