Compare commits
2 Commits
02b6ee04cc
...
9ddaa45146
| Author | SHA1 | Date | |
|---|---|---|---|
|
9ddaa45146
|
|||
|
28a4e45473
|
@@ -16,7 +16,7 @@ HauslaneFan = hauslane_ns.class_(
|
|||||||
)
|
)
|
||||||
|
|
||||||
CONFIG_SCHEMA = (
|
CONFIG_SCHEMA = (
|
||||||
fan.FAN_SCHEMA.extend({
|
fan.fan_schema(Fan).extend({
|
||||||
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(HauslaneFan),
|
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(HauslaneFan),
|
||||||
})
|
})
|
||||||
.extend(HAUSLANE_SCHEMA)
|
.extend(HAUSLANE_SCHEMA)
|
||||||
|
|||||||
@@ -94,23 +94,24 @@ void Hauslane::loop() {
|
|||||||
button_press(pin_down, true);
|
button_press(pin_down, true);
|
||||||
}
|
}
|
||||||
} else if (this->light_cur != this->light_target) {
|
} else if (this->light_cur != this->light_target) {
|
||||||
if (this->power) {
|
if (this->power && !this->light_target) {
|
||||||
// press light button
|
// request light turn off and fan is off, so simply hit power button
|
||||||
button_press(pin_light, true);
|
button_press(pin_power, true);
|
||||||
} else {
|
} else if (!this->power && this->light_target) {
|
||||||
// power on hood first
|
// power on hood first
|
||||||
button_press(pin_power, true);
|
button_press(pin_power, true);
|
||||||
|
} else if (this->power) {
|
||||||
|
// press light button
|
||||||
|
button_press(pin_light, true);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// target already met, so reset flag
|
// target already met, so reset flag
|
||||||
this->meet_target=false;
|
this->meet_target=false;
|
||||||
}
|
}
|
||||||
} else if (this->speed==0 && !this->light_cur) {
|
} else if (this->speed==0 && !this->light_cur && this->power) {
|
||||||
// reset power flag
|
// reset power flag
|
||||||
if(this->power) {
|
this->power=false;
|
||||||
this->power=false;
|
ESP_LOGD(TAG, "Hood power: %d", this->power);
|
||||||
ESP_LOGD(TAG, "Hood power: %d", this->power);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user