ESPHome  2022.8.0
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 
25  protected:
27  bool parse_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
28  bool parse_notifier_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
29  bool parse_warls_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
30  bool parse_drgb_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
31  bool parse_drgbw_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
32  bool parse_dnrgb_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size);
33 
34  uint16_t port_{0};
35  std::unique_ptr<UDP> udp_;
36  uint32_t blank_at_{0};
37  uint32_t dropped_{0};
38 };
39 
40 } // namespace wled
41 } // namespace esphome
42 
43 #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)
Definition: a4988.cpp:4
bool parse_warls_frame_(light::AddressableLight &it, const uint8_t *payload, uint16_t size)