Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation warnings #182

Merged
merged 4 commits into from
Nov 17, 2024
Merged
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
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