Mirror of espurna firmware for wireless switches and more
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.

40 lines
1.2 KiB

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