ESPHome 2025.5.0
Loading...
Searching...
No Matches
m5stack_8angle_light.h
Go to the documentation of this file.
1#pragma once
2
5
6#include "../m5stack_8angle.h"
7
8namespace esphome {
9namespace m5stack_8angle {
10
11static const uint8_t M5STACK_8ANGLE_NUM_LEDS = 9;
12static const uint8_t M5STACK_8ANGLE_BYTES_PER_LED = 4;
13
14class M5Stack8AngleLightOutput : public light::AddressableLight, public Parented<M5Stack8AngleComponent> {
15 public:
16 void setup() override;
17
18 void write_state(light::LightState *state) override;
19
20 int32_t size() const override { return M5STACK_8ANGLE_NUM_LEDS; }
22 auto traits = light::LightTraits();
23 traits.set_supported_color_modes({light::ColorMode::RGB});
24 return traits;
25 };
26
27 void clear_effect_data() override { memset(this->effect_data_, 0x00, M5STACK_8ANGLE_NUM_LEDS); };
28
29 protected:
30 light::ESPColorView get_view_internal(int32_t index) const override;
31
32 uint8_t *buf_{nullptr};
33 uint8_t *effect_data_{nullptr};
34};
35
36} // namespace m5stack_8angle
37} // namespace esphome
Helper class to easily give an object a parent of type T.
Definition helpers.h:538
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Definition light_state.h:63
This class is used to represent the capabilities of a light.
light::ESPColorView get_view_internal(int32_t index) const override
void write_state(light::LightState *state) override
bool state
Definition fan.h:0
@ RGB
RGB color output.
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7