ESPHome  1.15.3
Public Member Functions | Protected Member Functions | Protected Attributes
esphome::tuya::TuyaLight Class Reference

#include <tuya_light.h>

Inheritance diagram for esphome::tuya::TuyaLight:
esphome::Component esphome::light::LightOutput

Public Member Functions

void setup () override
void dump_config () override
void set_dimmer_id (uint8_t dimmer_id)
void set_switch_id (uint8_t switch_id)
void set_tuya_parent (Tuya *parent)
void set_min_value (uint32_t min_value)
void set_max_value (uint32_t max_value)
light::LightTraits get_traits () override
void setup_state (light::LightState *state) override
void write_state (light::LightState *state) override
- Public Member Functions inherited from esphome::Component
virtual void loop ()
 This method will be called repeatedly. More...
virtual float get_setup_priority () const
 priority of setup(). More...
float get_actual_setup_priority () const
void set_setup_priority (float priority)
virtual float get_loop_priority () const
 priority of loop(). More...
void call ()
virtual void on_shutdown ()
virtual void on_safe_shutdown ()
uint32_t get_component_state () const
virtual void mark_failed ()
 Mark this component as failed. More...
bool is_failed ()
virtual bool can_proceed ()
bool status_has_warning ()
bool status_has_error ()
void status_set_warning ()
void status_set_error ()
void status_clear_warning ()
void status_clear_error ()
void status_momentary_warning (const std::string &name, uint32_t length=5000)
void status_momentary_error (const std::string &name, uint32_t length=5000)
bool has_overridden_loop () const

Protected Member Functions

void update_dimmer_ (uint32_t value)
void update_switch_ (uint32_t value)
- Protected Member Functions inherited from esphome::Component
virtual void call_loop ()
virtual void call_setup ()
void set_interval (const std::string &name, uint32_t interval, std::function< void()> &&f)
 Set an interval function with a unique name. More...
void set_interval (uint32_t interval, std::function< void()> &&f)
bool cancel_interval (const std::string &name)
 Cancel an interval function. More...
void set_timeout (uint32_t timeout, std::function< void()> &&f)
void set_timeout (const std::string &name, uint32_t timeout, std::function< void()> &&f)
 Set a timeout function with a unique name. More...
bool cancel_timeout (const std::string &name)
 Cancel a timeout function. More...
void defer (const std::string &name, std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
void defer (std::function< void()> &&f)
 Defer a callback to the next loop() call. More...
bool cancel_defer (const std::string &name)
 Cancel a defer callback using the specified name, name must not be empty. More...

Protected Attributes

optional< uint8_t > dimmer_id_ {}
optional< uint8_t > switch_id_ {}
uint32_t min_value_ = 0
uint32_t max_value_ = 255
light::LightStatestate_ {nullptr}
- Protected Attributes inherited from esphome::Component
uint32_t component_state_ {0x0000}
 State of this component. More...
float setup_priority_override_ {NAN}

Detailed Description

Definition at line 10 of file tuya_light.h.

Member Function Documentation

◆ dump_config()

void esphome::tuya::TuyaLight::dump_config ( )

Reimplemented from esphome::Component.

Definition at line 26 of file tuya_light.cpp.

◆ get_traits()

light::LightTraits esphome::tuya::TuyaLight::get_traits ( )

Implements esphome::light::LightOutput.

Definition at line 34 of file tuya_light.cpp.

◆ set_dimmer_id()

void esphome::tuya::TuyaLight::set_dimmer_id ( uint8_t  dimmer_id)

Definition at line 14 of file tuya_light.h.

◆ set_max_value()

void esphome::tuya::TuyaLight::set_max_value ( uint32_t  max_value)

Definition at line 18 of file tuya_light.h.

◆ set_min_value()

void esphome::tuya::TuyaLight::set_min_value ( uint32_t  min_value)

Definition at line 17 of file tuya_light.h.

◆ set_switch_id()

void esphome::tuya::TuyaLight::set_switch_id ( uint8_t  switch_id)

Definition at line 15 of file tuya_light.h.

◆ set_tuya_parent()

void esphome::tuya::TuyaLight::set_tuya_parent ( Tuya parent)

Definition at line 16 of file tuya_light.h.

◆ setup()

void esphome::tuya::TuyaLight::setup ( )

Reimplemented from esphome::Component.

Definition at line 9 of file tuya_light.cpp.

◆ setup_state()

void esphome::tuya::TuyaLight::setup_state ( light::LightState state)

Reimplemented from esphome::light::LightOutput.

Definition at line 40 of file tuya_light.cpp.

◆ update_dimmer_()

void esphome::tuya::TuyaLight::update_dimmer_ ( uint32_t  value)

◆ update_switch_()

void esphome::tuya::TuyaLight::update_switch_ ( uint32_t  value)

◆ write_state()

void esphome::tuya::TuyaLight::write_state ( light::LightState state)

Implements esphome::light::LightOutput.

Definition at line 42 of file tuya_light.cpp.

Field Documentation

◆ dimmer_id_

optional<uint8_t> esphome::tuya::TuyaLight::dimmer_id_ {}

Definition at line 28 of file tuya_light.h.

◆ max_value_

uint32_t esphome::tuya::TuyaLight::max_value_ = 255

Definition at line 31 of file tuya_light.h.

◆ min_value_

uint32_t esphome::tuya::TuyaLight::min_value_ = 0

Definition at line 30 of file tuya_light.h.

◆ parent_

Tuya* esphome::tuya::TuyaLight::parent_

Definition at line 27 of file tuya_light.h.

◆ state_

light::LightState* esphome::tuya::TuyaLight::state_ {nullptr}

Definition at line 32 of file tuya_light.h.

◆ switch_id_

optional<uint8_t> esphome::tuya::TuyaLight::switch_id_ {}

Definition at line 29 of file tuya_light.h.

The documentation for this class was generated from the following files: