Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions esphome/components/daikin_madoka/daikin_madoka.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ void DaikinMadoka::loop() {
void DaikinMadoka::control(const ClimateCall &call) {
if (this->node_state != espbt::ClientState::ESTABLISHED)
return;
this->last_control_ms_ = millis();
if (call.get_mode().has_value()) {
ClimateMode mode = *call.get_mode();
uint8_t mode_out = 255, status_out = 0;
Expand Down Expand Up @@ -209,6 +210,11 @@ void DaikinMadoka::update() {
ESP_LOGD(TAG, "...but device is disconnected");
return;
}
if (this->last_control_ms_ > 0 && millis() - this->last_control_ms_ < 5000) {
ESP_LOGD(TAG, "...skipping, cooldown after control command");
return;
}
this->last_control_ms_ = 0;

std::vector<uint16_t> all_cmds{CMD_GET_SETTING_STATUS, CMD_GET_OPERATION_MODE, CMD_GET_SETPOINT, CMD_GET_FAN_SPEED,
CMD_GET_SENSOR_INFORMATION};
Expand Down
1 change: 1 addition & 0 deletions esphome/components/daikin_madoka/daikin_madoka.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ static const espbt::ESPBTUUID WWR_CHARACTERISTIC_UUID =
class DaikinMadoka : public climate::Climate, public esphome::ble_client::BLEClientNode, public PollingComponent {
protected:
bool should_update_ = false;
uint32_t last_control_ms_{0};
std::queue<std::vector<uint8_t>> received_chunks_ = {};
std::map<uint8_t, std::vector<uint8_t>> pending_chunks_ = {};
uint16_t notify_handle_;
Expand Down
Loading