Skip to content

Commit 85c723c

Browse files
Refined outdoor temperature processing in Samsung AC component
1 parent 39a3f82 commit 85c723c

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

components/samsung_ac/protocol_non_nasa.cpp

+15-2
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ namespace esphome
588588
// TODO
589589
target->set_target_water_temperature(nonpacket_.src, false);
590590
target->set_room_temperature(nonpacket_.src, nonpacket_.command20.room_temp);
591+
591592
target->set_power(nonpacket_.src, nonpacket_.command20.power);
592593
// TODO
593594
target->set_water_heater_power(nonpacket_.src, false);
@@ -645,9 +646,21 @@ namespace esphome
645646
}
646647
else if (nonpacket_.cmd == NonNasaCommand::CmdC0)
647648
{
648-
if (outdoor_temperature != nullptr)
649+
// Add checks to ensure pending messages are not overwritten
650+
bool pending_control_message = false;
651+
for (auto &item : nonnasa_requests)
652+
{
653+
if (item.time_sent > 0 && nonpacket_.src == item.request.dst)
654+
{
655+
pending_control_message = true;
656+
break;
657+
}
658+
}
659+
660+
if (!pending_control_message)
649661
{
650-
outdoor_temperature->publish_state(nonpacket_.commandC0.outdoor_unit_outdoor_temp_c);
662+
// Publish outdoor temperature if there are no pending control messages
663+
target->set_outdoor_temperature(nonpacket_.src, nonpacket_.commandC0.outdoor_unit_outdoor_temp_c);
651664
}
652665
}
653666
}

0 commit comments

Comments
 (0)