mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 11:25:35 +00:00
Mark user-configurable classes as final (part 18/21)
Add the C++ `final` specifier to leaf, user-configurable component classes and automation action/trigger/condition primitives so that classes meant to be terminal cannot be subclassed by external components. Only classes never used as a base anywhere in the tree are marked. Part 18 of 21, split alphabetically by component (template .. tx20).
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::template_ {
|
||||
|
||||
template<typename... Ts> class TemplateLockPublishAction : public Action<Ts...>, public Parented<TemplateLock> {
|
||||
template<typename... Ts> class TemplateLockPublishAction final : public Action<Ts...>, public Parented<TemplateLock> {
|
||||
public:
|
||||
TEMPLATABLE_VALUE(lock::LockState, state)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::template_ {
|
||||
|
||||
template<typename... Ts> class TemplateValvePublishAction : public Action<Ts...>, public Parented<TemplateValve> {
|
||||
template<typename... Ts> class TemplateValvePublishAction final : public Action<Ts...>, public Parented<TemplateValve> {
|
||||
TEMPLATABLE_VALUE(float, position)
|
||||
TEMPLATABLE_VALUE(valve::ValveOperation, current_operation)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
namespace esphome::template_ {
|
||||
|
||||
template<typename... Ts>
|
||||
class TemplateWaterHeaterPublishAction : public Action<Ts...>, public Parented<TemplateWaterHeater> {
|
||||
class TemplateWaterHeaterPublishAction final : public Action<Ts...>, public Parented<TemplateWaterHeater> {
|
||||
public:
|
||||
TEMPLATABLE_VALUE(float, current_temperature)
|
||||
TEMPLATABLE_VALUE(float, target_temperature)
|
||||
|
||||
@@ -13,7 +13,7 @@ enum TemplateWaterHeaterRestoreMode {
|
||||
WATER_HEATER_RESTORE_AND_CALL,
|
||||
};
|
||||
|
||||
class TemplateWaterHeater : public Component, public water_heater::WaterHeater {
|
||||
class TemplateWaterHeater final : public Component, public water_heater::WaterHeater {
|
||||
public:
|
||||
TemplateWaterHeater();
|
||||
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
|
||||
namespace esphome::text {
|
||||
|
||||
class TextStateTrigger : public Trigger<std::string> {
|
||||
class TextStateTrigger final : public Trigger<std::string> {
|
||||
public:
|
||||
explicit TextStateTrigger(Text *parent) {
|
||||
parent->add_on_state_callback([this](const std::string &value) { this->trigger(value); });
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... Ts> class TextSetAction : public Action<Ts...> {
|
||||
template<typename... Ts> class TextSetAction final : public Action<Ts...> {
|
||||
public:
|
||||
explicit TextSetAction(Text *text) : text_(text) {}
|
||||
TEMPLATABLE_VALUE(std::string, value)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::text {
|
||||
|
||||
class TextTextSensor : public text_sensor::TextSensor, public Component {
|
||||
class TextTextSensor final : public text_sensor::TextSensor, public Component {
|
||||
public:
|
||||
explicit TextTextSensor(Text *source) : source_(source) {}
|
||||
void setup() override;
|
||||
|
||||
@@ -8,21 +8,21 @@
|
||||
|
||||
namespace esphome::text_sensor {
|
||||
|
||||
class TextSensorStateTrigger : public Trigger<std::string> {
|
||||
class TextSensorStateTrigger final : public Trigger<std::string> {
|
||||
public:
|
||||
explicit TextSensorStateTrigger(TextSensor *parent) {
|
||||
parent->add_on_state_callback([this](const std::string &value) { this->trigger(value); });
|
||||
}
|
||||
};
|
||||
|
||||
class TextSensorStateRawTrigger : public Trigger<std::string> {
|
||||
class TextSensorStateRawTrigger final : public Trigger<std::string> {
|
||||
public:
|
||||
explicit TextSensorStateRawTrigger(TextSensor *parent) {
|
||||
parent->add_on_raw_state_callback([this](const std::string &value) { this->trigger(value); });
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... Ts> class TextSensorStateCondition : public Condition<Ts...> {
|
||||
template<typename... Ts> class TextSensorStateCondition final : public Condition<Ts...> {
|
||||
public:
|
||||
explicit TextSensorStateCondition(TextSensor *parent) : parent_(parent) {}
|
||||
|
||||
@@ -34,7 +34,7 @@ template<typename... Ts> class TextSensorStateCondition : public Condition<Ts...
|
||||
TextSensor *parent_;
|
||||
};
|
||||
|
||||
template<typename... Ts> class TextSensorPublishAction : public Action<Ts...> {
|
||||
template<typename... Ts> class TextSensorPublishAction final : public Action<Ts...> {
|
||||
public:
|
||||
TextSensorPublishAction(TextSensor *sensor) : sensor_(sensor) {}
|
||||
TEMPLATABLE_VALUE(std::string, state)
|
||||
|
||||
@@ -17,7 +17,7 @@ struct ParseResult {
|
||||
|
||||
using DeviceParser = optional<ParseResult> (*)(const uint8_t *data, std::size_t data_size);
|
||||
|
||||
class ThermoProBLE : public Component, public esp32_ble_tracker::ESPBTDeviceListener {
|
||||
class ThermoProBLE final : public Component, public esp32_ble_tracker::ESPBTDeviceListener {
|
||||
public:
|
||||
void set_address(uint64_t address) { this->address_ = address; };
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ struct ThermostatCustomPresetEntry {
|
||||
ThermostatClimateTargetTempConfig config;
|
||||
};
|
||||
|
||||
class ThermostatClimate : public climate::Climate, public Component {
|
||||
class ThermostatClimate final : public climate::Climate, public Component {
|
||||
public:
|
||||
using PresetEntry = ThermostatPresetEntry;
|
||||
using CustomPresetEntry = ThermostatCustomPresetEntry;
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
namespace esphome::time {
|
||||
|
||||
class CronTrigger : public Trigger<>, public Component {
|
||||
class CronTrigger final : public Trigger<>, public Component {
|
||||
public:
|
||||
explicit CronTrigger(RealTimeClock *rtc);
|
||||
void add_second(uint8_t second);
|
||||
@@ -41,7 +41,7 @@ class CronTrigger : public Trigger<>, public Component {
|
||||
optional<ESPTime> last_check_;
|
||||
};
|
||||
|
||||
class SyncTrigger : public Trigger<>, public Component {
|
||||
class SyncTrigger final : public Trigger<>, public Component {
|
||||
public:
|
||||
explicit SyncTrigger(RealTimeClock *rtc);
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class RealTimeClock : public PollingComponent {
|
||||
LazyCallbackManager<void()> time_sync_callback_;
|
||||
};
|
||||
|
||||
template<typename... Ts> class TimeHasTimeCondition : public Condition<Ts...> {
|
||||
template<typename... Ts> class TimeHasTimeCondition final : public Condition<Ts...> {
|
||||
public:
|
||||
TimeHasTimeCondition(RealTimeClock *parent) : parent_(parent) {}
|
||||
bool check(const Ts &...x) override { return this->parent_->now().is_valid(); }
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::time_based {
|
||||
|
||||
class TimeBasedCover : public cover::Cover, public Component {
|
||||
class TimeBasedCover final : public cover::Cover, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void loop() override;
|
||||
|
||||
@@ -19,7 +19,7 @@ enum USBDStringDescriptor : uint8_t {
|
||||
|
||||
static const char *const DEFAULT_USB_STR = "ESPHome";
|
||||
|
||||
class TinyUSB : public Component {
|
||||
class TinyUSB final : public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -21,7 +21,7 @@ inline constexpr uint8_t TLC59208F_MODE2_WDT_35MS = (3 << 0);
|
||||
|
||||
class TLC59208FOutput;
|
||||
|
||||
class TLC59208FChannel : public output::FloatOutput, public Parented<TLC59208FOutput> {
|
||||
class TLC59208FChannel final : public output::FloatOutput, public Parented<TLC59208FOutput> {
|
||||
public:
|
||||
void set_channel(uint8_t channel) { channel_ = channel; }
|
||||
|
||||
@@ -34,7 +34,7 @@ class TLC59208FChannel : public output::FloatOutput, public Parented<TLC59208FOu
|
||||
};
|
||||
|
||||
/// TLC59208F float output component.
|
||||
class TLC59208FOutput : public Component, public i2c::I2CDevice {
|
||||
class TLC59208FOutput final : public Component, public i2c::I2CDevice {
|
||||
public:
|
||||
TLC59208FOutput(uint8_t mode = TLC59208F_MODE2_OCH) : mode_(mode) {}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace esphome::tlc5947 {
|
||||
|
||||
class TLC5947Channel : public output::FloatOutput, public Parented<TLC5947> {
|
||||
class TLC5947Channel final : public output::FloatOutput, public Parented<TLC5947> {
|
||||
public:
|
||||
void set_channel(uint16_t channel) { this->channel_ = channel; }
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace esphome::tlc5947 {
|
||||
|
||||
class TLC5947 : public Component {
|
||||
class TLC5947 final : public Component {
|
||||
public:
|
||||
const uint8_t N_CHANNELS_PER_CHIP = 24;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace esphome::tlc5971 {
|
||||
|
||||
class TLC5971Channel : public output::FloatOutput, public Parented<TLC5971> {
|
||||
class TLC5971Channel final : public output::FloatOutput, public Parented<TLC5971> {
|
||||
public:
|
||||
void set_channel(uint16_t channel) { this->channel_ = channel; }
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace esphome::tlc5971 {
|
||||
|
||||
class TLC5971 : public Component {
|
||||
class TLC5971 final : public Component {
|
||||
public:
|
||||
const uint8_t N_CHANNELS_PER_CHIP = 12;
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class TM1621Display;
|
||||
|
||||
using tm1621_writer_t = display::DisplayWriter<TM1621Display>;
|
||||
|
||||
class TM1621Display : public PollingComponent {
|
||||
class TM1621Display final : public PollingComponent {
|
||||
public:
|
||||
void set_writer(tm1621_writer_t &&writer) { this->writer_ = writer; }
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class TM1637Key;
|
||||
|
||||
using tm1637_writer_t = display::DisplayWriter<TM1637Display>;
|
||||
|
||||
class TM1637Display : public PollingComponent {
|
||||
class TM1637Display final : public PollingComponent {
|
||||
public:
|
||||
void set_writer(tm1637_writer_t &&writer) { this->writer_ = writer; }
|
||||
|
||||
@@ -92,7 +92,7 @@ class TM1637Display : public PollingComponent {
|
||||
};
|
||||
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
class TM1637Key : public binary_sensor::BinarySensor {
|
||||
class TM1637Key final : public binary_sensor::BinarySensor {
|
||||
friend class TM1637Display;
|
||||
|
||||
public:
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace esphome::tm1638 {
|
||||
|
||||
class TM1638Key : public binary_sensor::BinarySensor, public KeyListener {
|
||||
class TM1638Key final : public binary_sensor::BinarySensor, public KeyListener {
|
||||
public:
|
||||
void set_keycode(uint8_t key_code) { key_code_ = key_code; };
|
||||
void keys_update(uint8_t keys) override;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tm1638 {
|
||||
|
||||
class TM1638OutputLed : public output::BinaryOutput, public Component {
|
||||
class TM1638OutputLed final : public output::BinaryOutput, public Component {
|
||||
public:
|
||||
void dump_config() override;
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tm1638 {
|
||||
|
||||
class TM1638SwitchLed : public switch_::Switch, public Component {
|
||||
class TM1638SwitchLed final : public switch_::Switch, public Component {
|
||||
public:
|
||||
void dump_config() override;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ class TM1638Component;
|
||||
|
||||
using tm1638_writer_t = display::DisplayWriter<TM1638Component>;
|
||||
|
||||
class TM1638Component : public PollingComponent {
|
||||
class TM1638Component final : public PollingComponent {
|
||||
public:
|
||||
void set_writer(tm1638_writer_t &&writer) { this->writer_ = writer; }
|
||||
void setup() override;
|
||||
|
||||
@@ -12,7 +12,7 @@ enum TM1651Brightness : uint8_t {
|
||||
TM1651_BRIGHTEST = 3,
|
||||
};
|
||||
|
||||
class TM1651Display : public Component {
|
||||
class TM1651Display final : public Component {
|
||||
public:
|
||||
void set_clk_pin(InternalGPIOPin *pin) { clk_pin_ = pin; }
|
||||
void set_dio_pin(InternalGPIOPin *pin) { dio_pin_ = pin; }
|
||||
@@ -56,7 +56,7 @@ class TM1651Display : public Component {
|
||||
uint8_t level_{0};
|
||||
};
|
||||
|
||||
template<typename... Ts> class SetBrightnessAction : public Action<Ts...>, public Parented<TM1651Display> {
|
||||
template<typename... Ts> class SetBrightnessAction final : public Action<Ts...>, public Parented<TM1651Display> {
|
||||
public:
|
||||
TEMPLATABLE_VALUE(uint8_t, brightness)
|
||||
|
||||
@@ -66,7 +66,7 @@ template<typename... Ts> class SetBrightnessAction : public Action<Ts...>, publi
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... Ts> class SetLevelAction : public Action<Ts...>, public Parented<TM1651Display> {
|
||||
template<typename... Ts> class SetLevelAction final : public Action<Ts...>, public Parented<TM1651Display> {
|
||||
public:
|
||||
TEMPLATABLE_VALUE(uint8_t, level)
|
||||
|
||||
@@ -76,7 +76,7 @@ template<typename... Ts> class SetLevelAction : public Action<Ts...>, public Par
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... Ts> class SetLevelPercentAction : public Action<Ts...>, public Parented<TM1651Display> {
|
||||
template<typename... Ts> class SetLevelPercentAction final : public Action<Ts...>, public Parented<TM1651Display> {
|
||||
public:
|
||||
TEMPLATABLE_VALUE(uint8_t, level_percent)
|
||||
|
||||
@@ -86,12 +86,12 @@ template<typename... Ts> class SetLevelPercentAction : public Action<Ts...>, pub
|
||||
}
|
||||
};
|
||||
|
||||
template<typename... Ts> class TurnOnAction : public Action<Ts...>, public Parented<TM1651Display> {
|
||||
template<typename... Ts> class TurnOnAction final : public Action<Ts...>, public Parented<TM1651Display> {
|
||||
public:
|
||||
void play(const Ts &...x) override { this->parent_->turn_on(); }
|
||||
};
|
||||
|
||||
template<typename... Ts> class TurnOffAction : public Action<Ts...>, public Parented<TM1651Display> {
|
||||
template<typename... Ts> class TurnOffAction final : public Action<Ts...>, public Parented<TM1651Display> {
|
||||
public:
|
||||
void play(const Ts &...x) override { this->parent_->turn_off(); }
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tmp102 {
|
||||
|
||||
class TMP102Component : public PollingComponent, public i2c::I2CDevice, public sensor::Sensor {
|
||||
class TMP102Component final : public PollingComponent, public i2c::I2CDevice, public sensor::Sensor {
|
||||
public:
|
||||
void dump_config() override;
|
||||
void update() override;
|
||||
|
||||
@@ -52,7 +52,7 @@ enum EAlertFunction {
|
||||
ALERT_INTERRUPT = 1,
|
||||
};
|
||||
|
||||
class TMP1075Sensor : public PollingComponent, public sensor::Sensor, public i2c::I2CDevice {
|
||||
class TMP1075Sensor final : public PollingComponent, public sensor::Sensor, public i2c::I2CDevice {
|
||||
public:
|
||||
void setup() override;
|
||||
void update() override;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tmp117 {
|
||||
|
||||
class TMP117Component : public PollingComponent, public i2c::I2CDevice, public sensor::Sensor {
|
||||
class TMP117Component final : public PollingComponent, public i2c::I2CDevice, public sensor::Sensor {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tof10120 {
|
||||
|
||||
class TOF10120Sensor : public sensor::Sensor, public PollingComponent, public i2c::I2CDevice {
|
||||
class TOF10120Sensor final : public sensor::Sensor, public PollingComponent, public i2c::I2CDevice {
|
||||
public:
|
||||
void setup() override;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace esphome::tormatic {
|
||||
|
||||
using namespace esphome::cover;
|
||||
|
||||
class Tormatic : public cover::Cover, public uart::UARTDevice, public PollingComponent {
|
||||
class Tormatic final : public cover::Cover, public uart::UARTDevice, public PollingComponent {
|
||||
public:
|
||||
void setup() override;
|
||||
void loop() override;
|
||||
|
||||
@@ -23,7 +23,7 @@ const float TOSHIBA_RAC_PT1411HWRU_TEMP_F_MAX = 86.0;
|
||||
const float TOSHIBA_RAS_2819T_TEMP_C_MIN = 18.0;
|
||||
const float TOSHIBA_RAS_2819T_TEMP_C_MAX = 30.0;
|
||||
|
||||
class ToshibaClimate : public climate_ir::ClimateIR {
|
||||
class ToshibaClimate final : public climate_ir::ClimateIR {
|
||||
public:
|
||||
ToshibaClimate()
|
||||
: climate_ir::ClimateIR(TOSHIBA_GENERIC_TEMP_C_MIN, TOSHIBA_GENERIC_TEMP_C_MAX, 1.0f, true, true,
|
||||
|
||||
@@ -14,7 +14,7 @@ enum TotalDailyEnergyMethod {
|
||||
TOTAL_DAILY_ENERGY_METHOD_RIGHT,
|
||||
};
|
||||
|
||||
class TotalDailyEnergy : public sensor::Sensor, public Component {
|
||||
class TotalDailyEnergy final : public sensor::Sensor, public Component {
|
||||
public:
|
||||
void set_restore(bool restore) { restore_ = restore; }
|
||||
void set_time(time::RealTimeClock *time) { time_ = time; }
|
||||
|
||||
@@ -10,10 +10,10 @@
|
||||
|
||||
namespace esphome::touchscreen {
|
||||
|
||||
class TouchscreenBinarySensor : public binary_sensor::BinarySensor,
|
||||
public Component,
|
||||
public TouchListener,
|
||||
public Parented<Touchscreen> {
|
||||
class TouchscreenBinarySensor final : public binary_sensor::BinarySensor,
|
||||
public Component,
|
||||
public TouchListener,
|
||||
public Parented<Touchscreen> {
|
||||
public:
|
||||
void setup() override;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ enum TSL2561Gain {
|
||||
};
|
||||
|
||||
/// This class includes support for the TSL2561 i2c ambient light sensor.
|
||||
class TSL2561Sensor : public sensor::Sensor, public PollingComponent, public i2c::I2CDevice {
|
||||
class TSL2561Sensor final : public sensor::Sensor, public PollingComponent, public i2c::I2CDevice {
|
||||
public:
|
||||
/** Set the time that sensor values should be accumulated for.
|
||||
*
|
||||
|
||||
@@ -63,7 +63,7 @@ enum TSL2591SensorChannel {
|
||||
/// light. They are reported as separate sensors, and the difference
|
||||
/// between the values is reported as a third sensor as a convenience
|
||||
/// for visible light only.
|
||||
class TSL2591Component : public PollingComponent, public i2c::I2CDevice {
|
||||
class TSL2591Component final : public PollingComponent, public i2c::I2CDevice {
|
||||
public:
|
||||
/** Set device integration time and gain.
|
||||
*
|
||||
|
||||
@@ -7,10 +7,10 @@
|
||||
|
||||
namespace esphome::tt21100 {
|
||||
|
||||
class TT21100Button : public binary_sensor::BinarySensor,
|
||||
public Component,
|
||||
public TT21100ButtonListener,
|
||||
public Parented<TT21100Touchscreen> {
|
||||
class TT21100Button final : public binary_sensor::BinarySensor,
|
||||
public Component,
|
||||
public TT21100ButtonListener,
|
||||
public Parented<TT21100Touchscreen> {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -16,7 +16,7 @@ class TT21100ButtonListener {
|
||||
virtual void update_button(uint8_t index, uint16_t state) = 0;
|
||||
};
|
||||
|
||||
class TT21100Touchscreen : public Touchscreen, public i2c::I2CDevice {
|
||||
class TT21100Touchscreen final : public Touchscreen, public i2c::I2CDevice {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace esphome::ttp229_bsf {
|
||||
|
||||
class TTP229BSFChannel : public binary_sensor::BinarySensor {
|
||||
class TTP229BSFChannel final : public binary_sensor::BinarySensor {
|
||||
public:
|
||||
void set_channel(uint8_t channel) { channel_ = channel; }
|
||||
void process(uint16_t data) { this->publish_state(data & (1 << this->channel_)); }
|
||||
@@ -17,7 +17,7 @@ class TTP229BSFChannel : public binary_sensor::BinarySensor {
|
||||
uint8_t channel_;
|
||||
};
|
||||
|
||||
class TTP229BSFComponent : public Component {
|
||||
class TTP229BSFComponent final : public Component {
|
||||
public:
|
||||
void set_sdo_pin(GPIOPin *sdo_pin) { sdo_pin_ = sdo_pin; }
|
||||
void set_scl_pin(GPIOPin *scl_pin) { scl_pin_ = scl_pin; }
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace esphome::ttp229_lsf {
|
||||
|
||||
class TTP229Channel : public binary_sensor::BinarySensor {
|
||||
class TTP229Channel final : public binary_sensor::BinarySensor {
|
||||
public:
|
||||
void set_channel(uint8_t channel) { channel_ = channel; }
|
||||
void process(uint16_t data) { this->publish_state(data & (1 << this->channel_)); }
|
||||
@@ -17,7 +17,7 @@ class TTP229Channel : public binary_sensor::BinarySensor {
|
||||
uint8_t channel_;
|
||||
};
|
||||
|
||||
class TTP229LSFComponent : public Component, public i2c::I2CDevice {
|
||||
class TTP229LSFComponent final : public Component, public i2c::I2CDevice {
|
||||
public:
|
||||
void register_channel(TTP229Channel *channel) { this->channels_.push_back(channel); }
|
||||
void setup() override;
|
||||
|
||||
@@ -8,44 +8,44 @@
|
||||
|
||||
namespace esphome::tuya {
|
||||
|
||||
class TuyaDatapointUpdateTrigger : public Trigger<TuyaDatapoint> {
|
||||
class TuyaDatapointUpdateTrigger final : public Trigger<TuyaDatapoint> {
|
||||
public:
|
||||
explicit TuyaDatapointUpdateTrigger(Tuya *parent, uint8_t sensor_id) {
|
||||
parent->register_listener(sensor_id, [this](const TuyaDatapoint &dp) { this->trigger(dp); });
|
||||
}
|
||||
};
|
||||
|
||||
class TuyaRawDatapointUpdateTrigger : public Trigger<std::vector<uint8_t>> {
|
||||
class TuyaRawDatapointUpdateTrigger final : public Trigger<std::vector<uint8_t>> {
|
||||
public:
|
||||
explicit TuyaRawDatapointUpdateTrigger(Tuya *parent, uint8_t sensor_id);
|
||||
};
|
||||
|
||||
class TuyaBoolDatapointUpdateTrigger : public Trigger<bool> {
|
||||
class TuyaBoolDatapointUpdateTrigger final : public Trigger<bool> {
|
||||
public:
|
||||
explicit TuyaBoolDatapointUpdateTrigger(Tuya *parent, uint8_t sensor_id);
|
||||
};
|
||||
|
||||
class TuyaIntDatapointUpdateTrigger : public Trigger<int> {
|
||||
class TuyaIntDatapointUpdateTrigger final : public Trigger<int> {
|
||||
public:
|
||||
explicit TuyaIntDatapointUpdateTrigger(Tuya *parent, uint8_t sensor_id);
|
||||
};
|
||||
|
||||
class TuyaUIntDatapointUpdateTrigger : public Trigger<uint32_t> {
|
||||
class TuyaUIntDatapointUpdateTrigger final : public Trigger<uint32_t> {
|
||||
public:
|
||||
explicit TuyaUIntDatapointUpdateTrigger(Tuya *parent, uint8_t sensor_id);
|
||||
};
|
||||
|
||||
class TuyaStringDatapointUpdateTrigger : public Trigger<std::string> {
|
||||
class TuyaStringDatapointUpdateTrigger final : public Trigger<std::string> {
|
||||
public:
|
||||
explicit TuyaStringDatapointUpdateTrigger(Tuya *parent, uint8_t sensor_id);
|
||||
};
|
||||
|
||||
class TuyaEnumDatapointUpdateTrigger : public Trigger<uint8_t> {
|
||||
class TuyaEnumDatapointUpdateTrigger final : public Trigger<uint8_t> {
|
||||
public:
|
||||
explicit TuyaEnumDatapointUpdateTrigger(Tuya *parent, uint8_t sensor_id);
|
||||
};
|
||||
|
||||
class TuyaBitmaskDatapointUpdateTrigger : public Trigger<uint32_t> {
|
||||
class TuyaBitmaskDatapointUpdateTrigger final : public Trigger<uint32_t> {
|
||||
public:
|
||||
explicit TuyaBitmaskDatapointUpdateTrigger(Tuya *parent, uint8_t sensor_id);
|
||||
};
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tuya {
|
||||
|
||||
class TuyaBinarySensor : public binary_sensor::BinarySensor, public Component {
|
||||
class TuyaBinarySensor final : public binary_sensor::BinarySensor, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tuya {
|
||||
|
||||
class TuyaClimate : public climate::Climate, public Component {
|
||||
class TuyaClimate final : public climate::Climate, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void loop() override;
|
||||
|
||||
@@ -12,7 +12,7 @@ enum TuyaCoverRestoreMode {
|
||||
COVER_RESTORE_AND_CALL,
|
||||
};
|
||||
|
||||
class TuyaCover : public cover::Cover, public Component {
|
||||
class TuyaCover final : public cover::Cover, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tuya {
|
||||
|
||||
class TuyaFan : public Component, public fan::Fan {
|
||||
class TuyaFan final : public Component, public fan::Fan {
|
||||
public:
|
||||
TuyaFan(Tuya *parent, int speed_count) : parent_(parent), speed_count_(speed_count) {}
|
||||
void setup() override;
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace esphome::tuya {
|
||||
|
||||
enum TuyaColorType { RGB, HSV, RGBHSV };
|
||||
|
||||
class TuyaLight : public Component, public light::LightOutput {
|
||||
class TuyaLight final : public Component, public light::LightOutput {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace esphome::tuya {
|
||||
|
||||
class TuyaNumber : public number::Number, public Component {
|
||||
class TuyaNumber final : public number::Number, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
namespace esphome::tuya {
|
||||
|
||||
class TuyaSelect : public select::Select, public Component {
|
||||
class TuyaSelect final : public select::Select, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tuya {
|
||||
|
||||
class TuyaSensor : public sensor::Sensor, public Component {
|
||||
class TuyaSensor final : public sensor::Sensor, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tuya {
|
||||
|
||||
class TuyaSwitch : public switch_::Switch, public Component {
|
||||
class TuyaSwitch final : public switch_::Switch, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
namespace esphome::tuya {
|
||||
|
||||
class TuyaTextSensor : public text_sensor::TextSensor, public Component {
|
||||
class TuyaTextSensor final : public text_sensor::TextSensor, public Component {
|
||||
public:
|
||||
void setup() override;
|
||||
void dump_config() override;
|
||||
|
||||
@@ -84,7 +84,7 @@ struct TuyaCommand {
|
||||
std::vector<uint8_t> payload;
|
||||
};
|
||||
|
||||
class Tuya : public Component, public uart::UARTDevice {
|
||||
class Tuya final : public Component, public uart::UARTDevice {
|
||||
public:
|
||||
float get_setup_priority() const override { return setup_priority::LATE; }
|
||||
void setup() override;
|
||||
|
||||
@@ -21,7 +21,7 @@ struct Tx20ComponentStore {
|
||||
};
|
||||
|
||||
/// This class implements support for the Tx20 Wind sensor.
|
||||
class Tx20Component : public Component {
|
||||
class Tx20Component final : public Component {
|
||||
public:
|
||||
/// Get the textual representation of the wind direction ('N', 'SSE', ..).
|
||||
std::string get_wind_cardinal_direction() const;
|
||||
|
||||
Reference in New Issue
Block a user