Skip to content

Commit 9cb13c7

Browse files
committed
compatiblity change to latest decode lib
1 parent 41b2c75 commit 9cb13c7

5 files changed

Lines changed: 15 additions & 12 deletions

File tree

110 Bytes
Binary file not shown.

private-backend/src/main/java/net/irext/decode/sdk/bean/ACStatus.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class ACStatus {
2424
private int acDisplay;
2525
private int acSleep;
2626
private int acTimer;
27-
private int changeWindDir;
27+
private Integer changeWindDir;
2828

2929
public ACStatus() {
3030
this.acPower = Constants.ACPower.POWER_OFF.getValue();
@@ -39,7 +39,7 @@ public ACStatus() {
3939
}
4040

4141
public ACStatus(int acPower, int acMode, int acTemp, int acWindSpeed, int acWindDir,
42-
int acDisplay, int acSleep, int acTimer, int changeWindDir) {
42+
int acDisplay, int acSleep, int acTimer, Integer changeWindDir) {
4343
this.acPower = acPower;
4444
this.acTemp = acTemp;
4545
this.acMode = acMode;
@@ -115,11 +115,11 @@ public void setAcTimer(int acTimer) {
115115
this.acTimer = acTimer;
116116
}
117117

118-
public int getChangeWindDir() {
118+
public Integer getChangeWindDir() {
119119
return changeWindDir;
120120
}
121121

122-
public void setChangeWindDir(int changeWindDir) {
122+
public void setChangeWindDir(Integer changeWindDir) {
123123
this.changeWindDir = changeWindDir;
124124
}
125125
}

private-backend/src/main/java/net/irext/server/businesslogic/OperationLogic.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,7 @@ public RemoteIndex prepareBinary(int remoteIndexId) {
116116
return remoteIndex;
117117
}
118118

119-
public int[] decodeIR(RemoteIndex remoteIndex, ACStatus acStatus,
120-
int keyCode, int changeWindDirection) {
119+
public int[] decodeIR(RemoteIndex remoteIndex, ACStatus acStatus, int keyCode) {
121120
try {
122121
int[] decoded = null;
123122
synchronized (this) {

private-backend/src/main/java/net/irext/server/request/DecodeRequest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ public class DecodeRequest extends BaseRequest {
1717
private int indexId;
1818
private ACStatus acStatus;
1919
private int keyCode;
20-
private int changeWindDir;
20+
private Integer changeWindDir;
2121
private Integer directDecode;
2222
private Integer paraData;
2323

24-
public DecodeRequest(int indexId, ACStatus acStatus, int keyCode, int changeWindDir,
24+
public DecodeRequest(int indexId, ACStatus acStatus, int keyCode, Integer changeWindDir,
2525
Integer directDecode, Integer paraData) {
2626
this.indexId = indexId;
2727
this.acStatus = acStatus;
@@ -59,11 +59,11 @@ public void setKeyCode(int keyCode) {
5959
this.keyCode = keyCode;
6060
}
6161

62-
public int getChangeWindDir() {
62+
public Integer getChangeWindDir() {
6363
return changeWindDir;
6464
}
6565

66-
public void setChangeWindDir(int changeWindDir) {
66+
public void setChangeWindDir(Integer changeWindDir) {
6767
this.changeWindDir = changeWindDir;
6868
}
6969

private-backend/src/main/java/net/irext/server/restapi/IROperationService.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,14 @@ public DecodeResponse decodeIR(@RequestBody DecodeRequest decodeRequest) {
147147
int indexId = decodeRequest.getIndexId();
148148
ACStatus acStatus = decodeRequest.getAcStatus();
149149
int keyCode = decodeRequest.getKeyCode();
150-
int changeWindDir = decodeRequest.getChangeWindDir();
150+
Integer changeWindDir = decodeRequest.getChangeWindDir();
151151
Integer directDecode = decodeRequest.getDirectDecode();
152152
Integer paraData = decodeRequest.getParaData();
153153
RemoteIndex remoteIndex = null;
154+
155+
if (null == acStatus.getChangeWindDir() && null != changeWindDir) {
156+
acStatus.setChangeWindDir(changeWindDir);
157+
}
154158
int[] decoded = null;
155159
LoggerUtil.getInstance().trace(TAG, "decodeIR entry, keyCode = " + keyCode + ", acStatus = " +
156160
new Gson().toJson(acStatus));
@@ -187,7 +191,7 @@ public DecodeResponse decodeIR(@RequestBody DecodeRequest decodeRequest) {
187191
}
188192
// NOTE: here remoteIndex instances changes
189193
remoteIndex = operationLogic.prepareBinary(remoteIndex.getId());
190-
decoded = operationLogic.decodeIR(remoteIndex, acStatus, keyCode, changeWindDir);
194+
decoded = operationLogic.decodeIR(remoteIndex, acStatus, keyCode);
191195
}
192196
}
193197
response.setEntity(decoded);

0 commit comments

Comments
 (0)