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.

64 lines
1.7 KiB

  1. // -----------------------------------------------------------------------------
  2. // Lights
  3. // -----------------------------------------------------------------------------
  4. #pragma once
  5. #include "espurna.h"
  6. // TODO: lowercase
  7. namespace Light {
  8. constexpr size_t ChannelsMax = 5;
  9. constexpr long VALUE_MIN = LIGHT_MIN_VALUE;
  10. constexpr long VALUE_MAX = LIGHT_MAX_VALUE;
  11. constexpr long BRIGHTNESS_MIN = LIGHT_MIN_BRIGHTNESS;
  12. constexpr long BRIGHTNESS_MAX = LIGHT_MAX_BRIGHTNESS;
  13. constexpr long PWM_MIN = LIGHT_MIN_PWM;
  14. constexpr long PWM_MAX = LIGHT_MAX_PWM;
  15. constexpr long PWM_LIMIT = LIGHT_LIMIT_PWM;
  16. enum Communications : unsigned char {
  17. COMMS_NONE = 0,
  18. COMMS_NORMAL = 1 << 0,
  19. COMMS_GROUP = 1 << 1
  20. };
  21. }
  22. size_t lightChannels();
  23. unsigned int lightTransitionTime();
  24. void lightTransitionTime(unsigned long ms);
  25. void lightColor(const char * color, bool rgb);
  26. void lightColor(const char * color);
  27. void lightColor(unsigned long color);
  28. String lightColor(bool rgb);
  29. String lightColor();
  30. void lightState(unsigned char i, bool state);
  31. bool lightState(unsigned char i);
  32. void lightState(bool state);
  33. bool lightState();
  34. void lightBrightness(long brightness);
  35. long lightBrightness();
  36. long lightChannel(unsigned char id);
  37. void lightChannel(unsigned char id, long value);
  38. void lightBrightnessStep(long steps, long multiplier = LIGHT_STEP);
  39. void lightChannelStep(unsigned char id, long steps, long multiplier = LIGHT_STEP);
  40. void lightUpdate(bool save, bool forward, bool group_forward);
  41. void lightUpdate(bool save, bool forward);
  42. bool lightHasColor();
  43. bool lightUseCCT();
  44. void lightMQTT();
  45. void lightSetupChannels(unsigned char size);
  46. void lightSetup();