MiLightRadioConfig.cpp 581 B

1234567891011121314151617181920212223
  1. #include <MiLightRadioConfig.h>
  2. const MiLightRadioConfig* MiLightRadioConfig::ALL_CONFIGS[] = {
  3. &MilightRgbwConfig,
  4. &MilightCctConfig,
  5. &MilightRgbCctConfig
  6. };
  7. MiLightRadioConfig* MiLightRadioConfig::fromString(const String& s) {
  8. if (s.equalsIgnoreCase("rgbw")) {
  9. return &MilightRgbwConfig;
  10. } else if (s.equalsIgnoreCase("cct")) {
  11. return &MilightCctConfig;
  12. } else if (s.equalsIgnoreCase("rgb_cct")) {
  13. return &MilightRgbCctConfig;
  14. }
  15. return NULL;
  16. }
  17. size_t MiLightRadioConfig::getPacketLength() const {
  18. return packetFormatter->getPacketLength();
  19. }