fan traits set more explicitly, ignore pycache
This commit is contained in:
@@ -9,4 +9,5 @@
|
|||||||
**/lib/
|
**/lib/
|
||||||
**/src/
|
**/src/
|
||||||
**/platformio.ini
|
**/platformio.ini
|
||||||
|
**/__pycache__
|
||||||
/secrets.yaml
|
/secrets.yaml
|
||||||
|
|||||||
@@ -7,8 +7,13 @@ namespace empty_custom_fan {
|
|||||||
static const char *TAG = "empty_custom_fan.fan";
|
static const char *TAG = "empty_custom_fan.fan";
|
||||||
|
|
||||||
void EmptyCustomFan::setup() {
|
void EmptyCustomFan::setup() {
|
||||||
auto traits = fan::FanTraits(this->oscillating_ != nullptr, false, this->direction_ != nullptr);
|
auto traits = fan::FanTraits();
|
||||||
|
traits.set_direction(false);
|
||||||
|
traits.set_oscillation(false);
|
||||||
|
traits.set_speed(false);
|
||||||
|
|
||||||
this->fan_->set_traits(traits);
|
this->fan_->set_traits(traits);
|
||||||
|
|
||||||
this->fan_->add_on_state_callback([this]() { this->next_update_ = true; });
|
this->fan_->add_on_state_callback([this]() { this->next_update_ = true; });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user