geoffdavis / esphome-mitsubishiheatpump

ESPHome Climate Component for Mitsubishi Heatpumps using direct serial connection
BSD 2-Clause "Simplified" License
498 stars 143 forks source link

Fix for crash when changing fan modes #120

Closed markalston closed 6 months ago

markalston commented 7 months ago

The ESP device crashes completely and knocks out communication whenever you try to change fan modes. With my fix the device is no longer crashing when changing fan modes.

The log line:

ESP_LOGV("control", "Requested fan mode is %s", *call.get_fan_mode());

crashes the device because fan mode returned is an integer not a string.

Also, the following line causes an error and needs a space:

switch(*call.get_fan_mode()) {

This pull request fixes issues:

83

59

wrouesnel commented 7 months ago

Testing the changes in this pull request, I get a hard abort crash when booting up on an ESP32 - which doesn't make much sense superficially. Taking a crack at debugging.

wrouesnel commented 7 months ago

Okay, investigating I'm not sure what got broken with all the other changes on this, but I'd suggest this should be refactored to the single line change of fixing the fan mode log line since I can confirm that works perfectly.

markalston commented 6 months ago

Looks like I accidentally made my pull request from my master branch which I am still working on and thus it messed up my pull request with a ton of additional changes. Oops.