Skip to content

Commit

Permalink
Merge pull request #182 from ldotlopez/main
Browse files Browse the repository at this point in the history
Fix compilation warnings
  • Loading branch information
echavet authored Nov 17, 2024
2 parents fb3772c + 14e7738 commit fb827f8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion components/cn105/climateControls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ void CN105Climate::checkPendingWantedSettings() {
this->sendWantedSettings();
}

void logCheckWantedSettingsMutex(wantedHeatpumpSettings settings) {
void logCheckWantedSettingsMutex(wantedHeatpumpSettings& settings) {

if (settings.hasBeenSent) {
ESP_LOGE("control", "Mutex lock faillure: wantedSettings should be locked while sending.");
Expand Down
8 changes: 4 additions & 4 deletions components/cn105/cn105.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ class CN105Climate : public climate::Climate, public Component, public uart::UAR
void prepareInfoPacket(uint8_t* packet, int length);
void prepareSetPacket(uint8_t* packet, int length);

void publishStateToHA(heatpumpSettings settings);
void publishStateToHA(heatpumpSettings& settings);
void publishWantedSettingsStateToHA();

void heatpumpUpdate(heatpumpSettings settings);
void heatpumpUpdate(heatpumpSettings& settings);

void statusChanged(heatpumpStatus status);

Expand All @@ -257,8 +257,8 @@ class CN105Climate : public climate::Climate, public Component, public uart::UAR
void setActionIfOperatingAndCompressorIsActiveTo(climate::ClimateAction action);
void hpPacketDebug(uint8_t* packet, unsigned int length, const char* packetDirection);

void debugSettings(const char* settingName, heatpumpSettings settings);
void debugSettings(const char* settingName, wantedHeatpumpSettings settings);
void debugSettings(const char* settingName, heatpumpSettings& settings);
void debugSettings(const char* settingName, wantedHeatpumpSettings& settings);
void debugStatus(const char* statusName, heatpumpStatus status);
void debugSettingsAndStatus(const char* settingName, heatpumpSettings settings, heatpumpStatus status);
void debugClimate(const char* settingName);
Expand Down
4 changes: 2 additions & 2 deletions components/cn105/hp_readings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ void CN105Climate::statusChanged(heatpumpStatus status) {
}


void CN105Climate::publishStateToHA(heatpumpSettings settings) {
void CN105Climate::publishStateToHA(heatpumpSettings& settings) {

if ((this->wantedSettings.mode == nullptr) && (this->wantedSettings.power == nullptr)) { // to prevent overwriting a user demand
checkPowerAndModeSettings(settings);
Expand Down Expand Up @@ -508,7 +508,7 @@ void CN105Climate::publishStateToHA(heatpumpSettings settings) {
}


void CN105Climate::heatpumpUpdate(heatpumpSettings settings) {
void CN105Climate::heatpumpUpdate(heatpumpSettings& settings) {
// settings correponds to current settings
ESP_LOGV(LOG_SETTINGS_TAG, "Settings received");

Expand Down
4 changes: 2 additions & 2 deletions components/cn105/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const char* CN105Climate::getIfNotNull(const char* what, const char* defaultValu
return what;
}

void CN105Climate::debugSettings(const char* settingName, wantedHeatpumpSettings settings) {
void CN105Climate::debugSettings(const char* settingName, wantedHeatpumpSettings& settings) {
#ifdef USE_ESP32
ESP_LOGD(LOG_ACTION_EVT_TAG, "[%s]-> [power: %s, target °C: %.1f, mode: %s, fan: %s, vane: %s, wvane: %s, hasChanged ? -> %s, hasBeenSent ? -> %s]",
getIfNotNull(settingName, "unnamed"),
Expand Down Expand Up @@ -98,7 +98,7 @@ void CN105Climate::debugClimate(const char* settingName) {



void CN105Climate::debugSettings(const char* settingName, heatpumpSettings settings) {
void CN105Climate::debugSettings(const char* settingName, heatpumpSettings& settings) {
#ifdef USE_ESP32
ESP_LOGD(LOG_SETTINGS_TAG, "[%s]-> [power: %s, target °C: %.1f, mode: %s, fan: %s, vane: %s, wvane: %s]",
getIfNotNull(settingName, "unnamed"),
Expand Down

0 comments on commit fb827f8

Please sign in to comment.