-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix const char * references going out of scope in change_states (#7)
- Loading branch information
1 parent
b9cdb7c
commit 86e1dff
Showing
3 changed files
with
98 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include <Arduino.h> | ||
#include <HeatPump.h> | ||
|
||
class HeatpumpSettings { | ||
public: | ||
HeatpumpSettings(const heatpumpSettings& settings) { | ||
power = settings.power; | ||
mode = settings.mode; | ||
temperature = settings.temperature; | ||
fan = settings.fan; | ||
vane = settings.vane; | ||
wideVane = settings.wideVane; | ||
iSee = settings.iSee; | ||
connected = settings.connected; | ||
} | ||
|
||
heatpumpSettings getRaw() const { | ||
return heatpumpSettings{ | ||
power : power.c_str(), | ||
mode : mode.c_str(), | ||
temperature : temperature, | ||
fan : fan.c_str(), | ||
vane : vane.c_str(), | ||
wideVane : wideVane.c_str(), | ||
iSee : iSee, | ||
connected : connected | ||
}; | ||
} | ||
|
||
String power; | ||
String mode; | ||
float temperature; | ||
String fan; | ||
String vane; // vertical vane, up/down | ||
String wideVane; // horizontal vane, left/right | ||
bool iSee; // iSee sensor, at the moment can only detect it, not set it | ||
bool connected; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters