ESPHome 2026.6.0-dev
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
9
10static const uint8_t M5STACK_8ANGLE_NUM_LEDS = 9;
11static const uint8_t M5STACK_8ANGLE_BYTES_PER_LED = 4;
12
13class M5Stack8AngleLightOutput : public light::AddressableLight, public Parented<M5Stack8AngleComponent> {
14 public:
15 void setup() override;
16
17 void write_state(light::LightState *state) override;
18
19 int32_t size() const override { return M5STACK_8ANGLE_NUM_LEDS; }
21 auto traits = light::LightTraits();
22 traits.set_supported_color_modes({light::ColorMode::RGB});
23 return traits;
24 };
25
26 void clear_effect_data() override { memset(this->effect_data_, 0x00, M5STACK_8ANGLE_NUM_LEDS); };
27
28 protected:
29 light::ESPColorView get_view_internal(int32_t index) const override;
30
31 uint8_t *buf_{nullptr};
32 uint8_t *effect_data_{nullptr};
33};
34
35} // namespace esphome::m5stack_8angle
Helper class to easily give an object a parent of type T.
Definition helpers.h:1861
This class represents the communication layer between the front-end MQTT layer and the hardware outpu...
Definition light_state.h:93
This class is used to represent the capabilities of a light.
Definition light_traits.h:9
light::ESPColorView get_view_internal(int32_t index) const override
void write_state(light::LightState *state) override
bool state
Definition fan.h:2
@ RGB
RGB color output.