Skip to content

Commit

Permalink
Fix 1x dhw
Browse files Browse the repository at this point in the history
  • Loading branch information
wrfz committed Sep 10, 2024
1 parent 4a274de commit 97adbaf
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions components/daikin_rotex_can/daikin_rotex_can.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,23 @@ void DaikinRotexCanComponent::set_generic_number(std::string const& id, float va
///////////////// Buttons /////////////////
void DaikinRotexCanComponent::dhw_run() {
TRequest const* pRequest = m_data_requests.get("target_hot_water_temperature");
if (pRequest != nullptr) {
number::Number* pNumber = pRequest->get_number();
if (pNumber != nullptr) {
const float temp = pNumber->state;
const std::string name = pRequest->getName();

const float temp = pRequest->get_sensor()->get_raw_state();
const std::string name = pRequest->getName();
m_data_requests.sendSet(name, 70);

m_data_requests.sendSet(name, 70);

m_dhw_run_lambdas.push_back([temp, name, this]() {
m_data_requests.sendSet(name, temp);
});
call_later([name, temp, this](){
m_data_requests.sendSet(name, temp);
}, 10*1000);
} else {
ESP_LOGE("dhw_rum", "Request doesn't have a Number!");
}
} else {
ESP_LOGE("dhw_rum", "Request couldn't be found!");
}
}

void DaikinRotexCanComponent::run_dhw_lambdas() {
Expand Down

0 comments on commit 97adbaf

Please sign in to comment.