compatiblity change to latest decode lib

This commit is contained in:
strawmanbobi
2026-01-12 15:45:39 +08:00
parent 41b2c75664
commit 9cb13c797e
5 changed files with 15 additions and 12 deletions

View File

@@ -24,7 +24,7 @@ public class ACStatus {
private int acDisplay;
private int acSleep;
private int acTimer;
private int changeWindDir;
private Integer changeWindDir;
public ACStatus() {
this.acPower = Constants.ACPower.POWER_OFF.getValue();
@@ -39,7 +39,7 @@ public class ACStatus {
}
public ACStatus(int acPower, int acMode, int acTemp, int acWindSpeed, int acWindDir,
int acDisplay, int acSleep, int acTimer, int changeWindDir) {
int acDisplay, int acSleep, int acTimer, Integer changeWindDir) {
this.acPower = acPower;
this.acTemp = acTemp;
this.acMode = acMode;
@@ -115,11 +115,11 @@ public class ACStatus {
this.acTimer = acTimer;
}
public int getChangeWindDir() {
public Integer getChangeWindDir() {
return changeWindDir;
}
public void setChangeWindDir(int changeWindDir) {
public void setChangeWindDir(Integer changeWindDir) {
this.changeWindDir = changeWindDir;
}
}

View File

@@ -116,8 +116,7 @@ public class OperationLogic {
return remoteIndex;
}
public int[] decodeIR(RemoteIndex remoteIndex, ACStatus acStatus,
int keyCode, int changeWindDirection) {
public int[] decodeIR(RemoteIndex remoteIndex, ACStatus acStatus, int keyCode) {
try {
int[] decoded = null;
synchronized (this) {

View File

@@ -17,11 +17,11 @@ public class DecodeRequest extends BaseRequest {
private int indexId;
private ACStatus acStatus;
private int keyCode;
private int changeWindDir;
private Integer changeWindDir;
private Integer directDecode;
private Integer paraData;
public DecodeRequest(int indexId, ACStatus acStatus, int keyCode, int changeWindDir,
public DecodeRequest(int indexId, ACStatus acStatus, int keyCode, Integer changeWindDir,
Integer directDecode, Integer paraData) {
this.indexId = indexId;
this.acStatus = acStatus;
@@ -59,11 +59,11 @@ public class DecodeRequest extends BaseRequest {
this.keyCode = keyCode;
}
public int getChangeWindDir() {
public Integer getChangeWindDir() {
return changeWindDir;
}
public void setChangeWindDir(int changeWindDir) {
public void setChangeWindDir(Integer changeWindDir) {
this.changeWindDir = changeWindDir;
}

View File

@@ -147,10 +147,14 @@ public class IROperationService extends AbstractBaseService {
int indexId = decodeRequest.getIndexId();
ACStatus acStatus = decodeRequest.getAcStatus();
int keyCode = decodeRequest.getKeyCode();
int changeWindDir = decodeRequest.getChangeWindDir();
Integer changeWindDir = decodeRequest.getChangeWindDir();
Integer directDecode = decodeRequest.getDirectDecode();
Integer paraData = decodeRequest.getParaData();
RemoteIndex remoteIndex = null;
if (null == acStatus.getChangeWindDir() && null != changeWindDir) {
acStatus.setChangeWindDir(changeWindDir);
}
int[] decoded = null;
LoggerUtil.getInstance().trace(TAG, "decodeIR entry, keyCode = " + keyCode + ", acStatus = " +
new Gson().toJson(acStatus));
@@ -187,7 +191,7 @@ public class IROperationService extends AbstractBaseService {
}
// NOTE: here remoteIndex instances changes
remoteIndex = operationLogic.prepareBinary(remoteIndex.getId());
decoded = operationLogic.decodeIR(remoteIndex, acStatus, keyCode, changeWindDir);
decoded = operationLogic.decodeIR(remoteIndex, acStatus, keyCode);
}
}
response.setEntity(decoded);