fan traits set more explicitly, ignore pycache

master
HB 5 years ago
parent 54c7dabb67
commit c80ba1b09c

1
.gitignore vendored

@ -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; });
} }

Loading…
Cancel
Save