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:
@@ -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); }
|
||||
|
@@ -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.
|
||||
|
@@ -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_; }
|
||||
|
Reference in New Issue
Block a user