1

Compare commits

..

2 Commits

Author SHA1 Message Date
kenji 9ddaa45146 update light logic 2025-07-02 19:34:24 -04:00
kenji 28a4e45473 Update deprecated FAN_SCHEMA to fan_schema 2025-07-02 19:33:39 -04:00
2 changed files with 11 additions and 10 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ HauslaneFan = hauslane_ns.class_(
)
CONFIG_SCHEMA = (
fan.FAN_SCHEMA.extend({
fan.fan_schema(Fan).extend({
cv.GenerateID(CONF_OUTPUT_ID): cv.declare_id(HauslaneFan),
})
.extend(HAUSLANE_SCHEMA)
+8 -7
View File
@@ -94,27 +94,28 @@ void Hauslane::loop() {
button_press(pin_down, true);
}
} else if (this->light_cur != this->light_target) {
if (this->power) {
// press light button
button_press(pin_light, true);
} else {
if (this->power && !this->light_target) {
// request light turn off and fan is off, so simply hit power button
button_press(pin_power, true);
} else if (!this->power && this->light_target) {
// power on hood first
button_press(pin_power, true);
} else if (this->power) {
// press light button
button_press(pin_light, true);
}
} else {
// target already met, so reset flag
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
if(this->power) {
this->power=false;
ESP_LOGD(TAG, "Hood power: %d", this->power);
}
}
}
}
}
// Components are required to dump their configuration using ESP_LOGCONFIG in
// the dump_config() method. This method is used exclusively to print values