mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-25 14:55:55 +01:00
[daikin] Fix changing specialmode from ECO to NORMAL (#13230)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>
This commit is contained in:
parent
0e3a9f3c7e
commit
e916974e38
@ -137,14 +137,18 @@ public class DaikinWebTargets {
|
||||
return EnergyInfoDayAndWeek.parse(response);
|
||||
}
|
||||
|
||||
public void setSpecialMode(SpecialMode specialMode) throws DaikinCommunicationException {
|
||||
public void setSpecialMode(SpecialMode newMode) throws DaikinCommunicationException {
|
||||
Map<String, String> queryParams = new HashMap<>();
|
||||
if (specialMode == SpecialMode.NORMAL) {
|
||||
if (newMode == SpecialMode.NORMAL) {
|
||||
queryParams.put("set_spmode", "0");
|
||||
queryParams.put("spmode_kind", "1");
|
||||
|
||||
ControlInfo controlInfo = getControlInfo();
|
||||
if (!controlInfo.advancedMode.isUndefined()) {
|
||||
queryParams.put("spmode_kind", controlInfo.getSpecialMode().getValue());
|
||||
}
|
||||
} else {
|
||||
queryParams.put("set_spmode", "1");
|
||||
queryParams.put("spmode_kind", Integer.toString(specialMode.getValue()));
|
||||
queryParams.put("spmode_kind", newMode.getValue());
|
||||
}
|
||||
String response = invoke(setSpecialModeUri, queryParams);
|
||||
if (!response.contains("ret=OK")) {
|
||||
|
@ -181,17 +181,17 @@ public class Enums {
|
||||
}
|
||||
|
||||
public enum SpecialMode {
|
||||
NORMAL(0),
|
||||
POWERFUL(1),
|
||||
ECO(2);
|
||||
NORMAL("0"),
|
||||
POWERFUL("1"),
|
||||
ECO("2");
|
||||
|
||||
private final int value;
|
||||
private final String value;
|
||||
|
||||
SpecialMode(int value) {
|
||||
SpecialMode(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public int getValue() {
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user