mirror of
https://github.com/esphome/esphome.git
synced 2026-09-11 23:37:34 +00:00
[ld2450] Mark configurable classes as final
Add the C++ final specifier to LD2450Component and its leaf button/number/select/ switch entity classes. Split out of the mechanical final-only series because the C++ unit test in tests/components/ld2450/common.h subclasses LD2450Component (TestableLD2450) to expose protected members, so marking the component final breaks that test. Draft pending a decision on how to handle the test.
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace esphome::ld2450 {
|
||||
|
||||
class FactoryResetButton : public button::Button, public Parented<LD2450Component> {
|
||||
class FactoryResetButton final : public button::Button, public Parented<LD2450Component> {
|
||||
public:
|
||||
FactoryResetButton() = default;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace esphome::ld2450 {
|
||||
|
||||
class RestartButton : public button::Button, public Parented<LD2450Component> {
|
||||
class RestartButton final : public button::Button, public Parented<LD2450Component> {
|
||||
public:
|
||||
RestartButton() = default;
|
||||
|
||||
|
||||
@@ -75,7 +75,7 @@ struct ZoneOfNumbers {
|
||||
};
|
||||
#endif
|
||||
|
||||
class LD2450Component : public Component, public uart::UARTDevice {
|
||||
class LD2450Component final : public Component, public uart::UARTDevice {
|
||||
#ifdef USE_BINARY_SENSOR
|
||||
SUB_BINARY_SENSOR(moving_target)
|
||||
SUB_BINARY_SENSOR(still_target)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace esphome::ld2450 {
|
||||
|
||||
class PresenceTimeoutNumber : public number::Number, public Parented<LD2450Component> {
|
||||
class PresenceTimeoutNumber final : public number::Number, public Parented<LD2450Component> {
|
||||
public:
|
||||
PresenceTimeoutNumber() = default;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace esphome::ld2450 {
|
||||
|
||||
class ZoneCoordinateNumber : public number::Number, public Parented<LD2450Component> {
|
||||
class ZoneCoordinateNumber final : public number::Number, public Parented<LD2450Component> {
|
||||
public:
|
||||
ZoneCoordinateNumber(uint8_t zone);
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace esphome::ld2450 {
|
||||
|
||||
class BaudRateSelect : public select::Select, public Parented<LD2450Component> {
|
||||
class BaudRateSelect final : public select::Select, public Parented<LD2450Component> {
|
||||
public:
|
||||
BaudRateSelect() = default;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace esphome::ld2450 {
|
||||
|
||||
class ZoneTypeSelect : public select::Select, public Parented<LD2450Component> {
|
||||
class ZoneTypeSelect final : public select::Select, public Parented<LD2450Component> {
|
||||
public:
|
||||
ZoneTypeSelect() = default;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace esphome::ld2450 {
|
||||
|
||||
class BluetoothSwitch : public switch_::Switch, public Parented<LD2450Component> {
|
||||
class BluetoothSwitch final : public switch_::Switch, public Parented<LD2450Component> {
|
||||
public:
|
||||
BluetoothSwitch() = default;
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
namespace esphome::ld2450 {
|
||||
|
||||
class MultiTargetSwitch : public switch_::Switch, public Parented<LD2450Component> {
|
||||
class MultiTargetSwitch final : public switch_::Switch, public Parented<LD2450Component> {
|
||||
public:
|
||||
MultiTargetSwitch() = default;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user