Skip to content

Commit

Permalink
add temp hack to see if that stops some weird bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
KazWolfe committed May 27, 2024
1 parent c40713b commit 8431a04
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
14 changes: 14 additions & 0 deletions esphome/components/mitsubishi_uart/mitsubishi_uart-climatecall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,20 @@ void MitsubishiUART::control(const climate::ClimateCall &call) {
if (call.get_target_temperature().has_value()) {
target_temperature = call.get_target_temperature().value();
set_request_packet.set_target_temperature(call.get_target_temperature().value());

// FIXME: (Do not merge while this is present!)
// HACK: Sync temperature to the appropriate state
switch (mode) {
case climate::CLIMATE_MODE_HEAT:
target_temperature_high = target_temperature;
break;
case climate::CLIMATE_MODE_COOL:
case climate::CLIMATE_MODE_DRY:
target_temperature_low = target_temperature;
break;
default:
break;
}
}

// TODO:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,10 +390,8 @@ void MitsubishiUART::process_packet(const KumoThermostatHelloPacket &packet) {
void MitsubishiUART::process_packet(const KumoThermostatStateSyncPacket &packet) {
ESP_LOGV(TAG, "Processing inbound %s", packet.to_string().c_str());

if (this->traits().get_supports_two_point_target_temperature()) {
if (packet.get_flags() & 0x08) this->target_temperature_low = packet.get_heat_setpoint();
if (packet.get_flags() & 0x10) this->target_temperature_high = packet.get_cool_setpoint();
}
if (packet.get_flags() & 0x08) this->target_temperature_low = packet.get_heat_setpoint();
if (packet.get_flags() & 0x10) this->target_temperature_high = packet.get_cool_setpoint();

ts_bridge_->send_packet(SetResponsePacket());
}
Expand All @@ -414,10 +412,8 @@ void MitsubishiUART::process_packet(const SetResponsePacket &packet) {
void MitsubishiUART::handle_kumo_adapter_state_get_request(const GetRequestPacket &packet) {
auto response = KumoCloudStateSyncPacket();

if (this->traits().get_supports_two_point_target_temperature()) {
response.set_heat_setpoint(this->target_temperature_high);
response.set_cool_setpoint(this->target_temperature_low);
}
response.set_heat_setpoint(this->target_temperature_high);
response.set_cool_setpoint(this->target_temperature_low);

if (this->time_source != nullptr) {
response.set_timestamp(this->time_source->now());
Expand Down

0 comments on commit 8431a04

Please sign in to comment.