ESPHome  2024.4.1
wled_light_effect.h
Go to the documentation of this file.
1 #pragma once
2 
3 #ifdef USE_ARDUINO
4 
7 
8 #include <vector>
9 #include <memory>
10 
11 class UDP;
12 
13 namespace esphome {
14 namespace wled {
15 
17  public:
18  WLEDLightEffect(const std::string &name);
19 
20  void start() override;
21  void stop() override;
22  void apply(light::AddressableLight &it, const Color &current_color) override;
23  void set_port(uint16_t port) { this->port_ = port; }
24  void set_sync_group_mask(uint8_t mask) { this->sync_group_mask_ = mask; }
25  void set_blank_on_start(bool blank) { this->blank_on_start_ = blank; }
26 
27  protected:
29  bool parse_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
30  bool parse_notifier_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
31  bool parse_warls_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
32  bool parse_drgb_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
33  bool parse_drgbw_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
34  bool parse_dnrgb_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
35 
36  uint16_t port_{0};
37  std::unique_ptr<UDP> udp_;
38  uint32_t blank_at_{0};
39  uint32_t dropped_{0};
40  uint8_t sync_group_mask_{0};
41  bool blank_on_start_{true};
42 };
43 
44 } // namespace wled
45 } // namespace esphome
46 
47 #endif // USE_ARDUINO
const char * name
Definition: stm32flash.h:78
bool parse_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size)
bool parse_notifier_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size)
bool parse_dnrgb_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size)
std::unique_ptr< UDP > udp_
bool parse_drgbw_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size)
bool parse_drgb_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size)
void blank_all_leds_(light::AddressableLight &it)
WLEDLightEffect(const std::string &name)
This is a workaround until we can figure out a way to get the tflite-micro idf component code availab...
Definition: a01nyub.cpp:7
bool parse_warls_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size)
void set_sync_group_mask(uint8_t mask)