Fork of the espurna firmware for `mhsw` switches
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.

42 lines
1.2 KiB

  1. // -----------------------------------------------------------------------------
  2. // Lights
  3. // -----------------------------------------------------------------------------
  4. #pragma once
  5. namespace Light {
  6. constexpr const size_t CHANNELS_MAX = 5;
  7. constexpr const long VALUE_MIN = LIGHT_MIN_VALUE;
  8. constexpr const long VALUE_MAX = LIGHT_MAX_VALUE;
  9. constexpr const long BRIGHTNESS_MIN = LIGHT_MIN_BRIGHTNESS;
  10. constexpr const long BRIGHTNESS_MAX = LIGHT_MAX_BRIGHTNESS;
  11. constexpr const long PWM_MIN = LIGHT_MIN_PWM;
  12. constexpr const long PWM_MAX = LIGHT_MAX_PWM;
  13. constexpr const long PWM_LIMIT = LIGHT_LIMIT_PWM;
  14. enum Communications : unsigned char {
  15. COMMS_NONE = 0,
  16. COMMS_NORMAL = 1 << 0,
  17. COMMS_GROUP = 1 << 1
  18. };
  19. }
  20. size_t lightChannels();
  21. void lightState(unsigned char i, bool state);
  22. bool lightState(unsigned char i);
  23. void lightState(bool state);
  24. bool lightState();
  25. void lightBrightness(long brightness);
  26. long lightBrightness();
  27. long lightChannel(unsigned char id);
  28. void lightChannel(unsigned char id, long value);
  29. void lightBrightnessStep(long steps, long multiplier = LIGHT_STEP);
  30. void lightChannelStep(unsigned char id, long steps, long multiplier = LIGHT_STEP);