1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-04 02:52:22 +01:00

EntityBase Name can stay in flash. (#4594)

* `EntityBase`can stay in flash.

* Trying to please the CI.

---------

Co-authored-by: Your Name <you@example.com>
This commit is contained in:
Fabian
2023-03-28 08:38:56 +02:00
committed by GitHub
parent 1f50bd0649
commit cb2fcaa9b1
26 changed files with 161 additions and 63 deletions

View File

@@ -80,9 +80,6 @@ void FanRestoreState::apply(Fan &fan) {
fan.publish_state();
}
Fan::Fan() : EntityBase("") {}
Fan::Fan(const std::string &name) : EntityBase(name) {}
FanCall Fan::turn_on() { return this->make_call().set_state(true); }
FanCall Fan::turn_off() { return this->make_call().set_state(false); }
FanCall Fan::toggle() { return this->make_call().set_state(!this->state); }

View File

@@ -99,10 +99,6 @@ struct FanRestoreState {
class Fan : public EntityBase {
public:
Fan();
/// Construct the fan with name.
explicit Fan(const std::string &name);
/// The current on/off state of the fan.
bool state{false};
/// The current oscillation state of the fan.

View File

@@ -15,7 +15,6 @@ enum ESPDEPRECATED("LegacyFanDirection members are deprecated, use FanDirection
class ESPDEPRECATED("FanState is deprecated, use Fan instead.", "2022.2") FanState : public Fan, public Component {
public:
FanState() = default;
explicit FanState(const std::string &name) : Fan(name) {}
/// Get the traits of this fan.
FanTraits get_traits() override { return this->traits_; }