[daikin] Fix changing specialmode from ECO to NORMAL (#13230)
Signed-off-by: Jimmy Tanagra <jcode@tanagra.id.au>pull/13228/head
parent
0e3a9f3c7e
commit
e916974e38
|
@ -137,14 +137,18 @@ public class DaikinWebTargets {
|
||||||
return EnergyInfoDayAndWeek.parse(response);
|
return EnergyInfoDayAndWeek.parse(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSpecialMode(SpecialMode specialMode) throws DaikinCommunicationException {
|
public void setSpecialMode(SpecialMode newMode) throws DaikinCommunicationException {
|
||||||
Map<String, String> queryParams = new HashMap<>();
|
Map<String, String> queryParams = new HashMap<>();
|
||||||
if (specialMode == SpecialMode.NORMAL) {
|
if (newMode == SpecialMode.NORMAL) {
|
||||||
queryParams.put("set_spmode", "0");
|
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 {
|
} else {
|
||||||
queryParams.put("set_spmode", "1");
|
queryParams.put("set_spmode", "1");
|
||||||
queryParams.put("spmode_kind", Integer.toString(specialMode.getValue()));
|
queryParams.put("spmode_kind", newMode.getValue());
|
||||||
}
|
}
|
||||||
String response = invoke(setSpecialModeUri, queryParams);
|
String response = invoke(setSpecialModeUri, queryParams);
|
||||||
if (!response.contains("ret=OK")) {
|
if (!response.contains("ret=OK")) {
|
||||||
|
|
|
@ -181,17 +181,17 @@ public class Enums {
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum SpecialMode {
|
public enum SpecialMode {
|
||||||
NORMAL(0),
|
NORMAL("0"),
|
||||||
POWERFUL(1),
|
POWERFUL("1"),
|
||||||
ECO(2);
|
ECO("2");
|
||||||
|
|
||||||
private final int value;
|
private final String value;
|
||||||
|
|
||||||
SpecialMode(int value) {
|
SpecialMode(String value) {
|
||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getValue() {
|
public String getValue() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue