Neopixelbus Lights

API Reference

enum light::ESPNeoPixelOrder

Values:

GBWR = 0b11000110
GBRW = 0b10000111
GBR = 0b10000111
GWBR = 0b11001001
GRBW = 0b01001011
GRB = 0b01001011
GWRB = 0b10001101
GRWB = 0b01001110
BGWR = 0b11010010
BGRW = 0b10010011
BGR = 0b10010011
WGBR = 0b11011000
RGBW = 0b00011011
RGB = 0b00011011
WGRB = 0b10011100
RGWB = 0b00011110
BWGR = 0b11100001
BRGW = 0b01100011
BRG = 0b01100011
WBGR = 0b11100100
RBGW = 0b00100111
RBG = 0b00100111
WRGB = 0b01101100
RWGB = 0b00101101
BWRG = 0b10110001
BRWG = 0b01110010
WBRG = 0b10110100
RBWG = 0b00110110
WRBG = 0b01111000
RWBG = 0b00111001
template <typename T_METHOD, typename T_COLOR_FEATURE>
class NeoPixelBusLightOutputBase : public Component, public light::AddressableLight

This component implements support for many types of addressable LED lights.

To do this, it uses the NeoPixelBus library. The API for setting up the different types of lights NeoPixelBus supports is intentionally kept as close to NeoPixelBus defaults as possible. To use NeoPixelBus lights with esphomelib, first set up the component using the helper in Application, then add the LEDs using the add_leds helper functions.

These add_leds helpers can, however, only be called once on a NeoPixelBusLightOutputComponent.

Subclassed by light::NeoPixelRGBLightOutput< T_METHOD, T_COLOR_FEATURE >, light::NeoPixelRGBWLightOutput< T_METHOD, T_COLOR_FEATURE >

Public Functions

void schedule_show()
void set_power_supply(PowerSupplyComponent *power_supply)
NeoPixelBus<T_COLOR_FEATURE, T_METHOD> *get_controller() const
void set_correction(float red, float green, float blue, float white = 0.0f)
void clear_effect_data()
void setup_state(LightState *state)
void add_leds(uint16_t count_pixels, uint8_t pin)

Add some LEDS, can only be called once.

void add_leds(uint16_t count_pixels, uint8_t pin_clock, uint8_t pin_data)
void add_leds(uint16_t count_pixels)
void add_leds(NeoPixelBus<T_COLOR_FEATURE, T_METHOD> *controller)
void write_state(LightState *state)
void setup()
void loop()
float get_setup_priority() const
int32_t size() const
void set_pixel_order(ESPNeoPixelOrder order)

Protected Attributes

NeoPixelBus<T_COLOR_FEATURE, T_METHOD> *controller_ = {nullptr}
bool next_show_ = {true}
ESPColorCorrection correction_ = {}
uint8_t *effect_data_ = {nullptr}
template<>
uint8_t rgb_offsets_[4]
PowerSupplyComponent *power_supply_ = {nullptr}
bool has_requested_high_power_ = {false}
template <typename T_METHOD, typename T_COLOR_FEATURE = NeoRgbFeature>
class NeoPixelRGBLightOutput : public light::NeoPixelBusLightOutputBase<T_METHOD, T_COLOR_FEATURE>

Public Functions

ESPColorView operator[](int32_t index) const
LightTraits get_traits()
template <typename T_METHOD, typename T_COLOR_FEATURE = NeoRgbwFeature>
class NeoPixelRGBWLightOutput : public light::NeoPixelBusLightOutputBase<T_METHOD, T_COLOR_FEATURE>

Public Functions

ESPColorView operator[](int32_t index) const
LightTraits get_traits()