mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
* Fix Paradox EVOHD zone parsing fail #10572 * Root cause is that EVOHD and EVO192 have much more zones which are stored in a different memory map model. They should be treated the same way. Fix is simple and can be downported to 3.x if decided by the maintainers Signed-off-by: Konstantin Polihronov <polychronov@gmail.com>
This commit is contained in:
parent
42ba975660
commit
5f31eeb506
@ -193,7 +193,7 @@ public class EvoCommunicator extends GenericCommunicator implements IParadoxComm
|
|||||||
private void createZoneOpenedFlags(ZoneStateFlags result, byte[] firstPage, byte[] secondPage) {
|
private void createZoneOpenedFlags(ZoneStateFlags result, byte[] firstPage, byte[] secondPage) {
|
||||||
int pageOffset = panelType == PanelType.EVO48 ? 34 : 40;
|
int pageOffset = panelType == PanelType.EVO48 ? 34 : 40;
|
||||||
byte[] firstBlock = Arrays.copyOfRange(firstPage, 28, pageOffset);
|
byte[] firstBlock = Arrays.copyOfRange(firstPage, 28, pageOffset);
|
||||||
if (panelType != PanelType.EVO192) {
|
if (!PanelType.isBigRamEvo(panelType)) {
|
||||||
result.setZonesOpened(firstBlock);
|
result.setZonesOpened(firstBlock);
|
||||||
} else {
|
} else {
|
||||||
byte[] secondBlock = Arrays.copyOfRange(secondPage, 0, 12);
|
byte[] secondBlock = Arrays.copyOfRange(secondPage, 0, 12);
|
||||||
@ -205,7 +205,7 @@ public class EvoCommunicator extends GenericCommunicator implements IParadoxComm
|
|||||||
private void createZoneTamperedFlags(ZoneStateFlags result, byte[] firstPage, byte[] secondPage) {
|
private void createZoneTamperedFlags(ZoneStateFlags result, byte[] firstPage, byte[] secondPage) {
|
||||||
int pageOffset = panelType == PanelType.EVO48 ? 46 : 52;
|
int pageOffset = panelType == PanelType.EVO48 ? 46 : 52;
|
||||||
byte[] firstBlock = Arrays.copyOfRange(firstPage, 40, pageOffset);
|
byte[] firstBlock = Arrays.copyOfRange(firstPage, 40, pageOffset);
|
||||||
if (panelType != PanelType.EVO192) {
|
if (!PanelType.isBigRamEvo(panelType)) {
|
||||||
result.setZonesTampered(firstBlock);
|
result.setZonesTampered(firstBlock);
|
||||||
} else {
|
} else {
|
||||||
byte[] secondBlock = Arrays.copyOfRange(secondPage, 12, 24);
|
byte[] secondBlock = Arrays.copyOfRange(secondPage, 12, 24);
|
||||||
@ -217,7 +217,7 @@ public class EvoCommunicator extends GenericCommunicator implements IParadoxComm
|
|||||||
private void createZoneLowbatteryFlags(ZoneStateFlags result, byte[] firstPage, byte[] secondPage) {
|
private void createZoneLowbatteryFlags(ZoneStateFlags result, byte[] firstPage, byte[] secondPage) {
|
||||||
int pageOffset = panelType == PanelType.EVO48 ? 58 : 64;
|
int pageOffset = panelType == PanelType.EVO48 ? 58 : 64;
|
||||||
byte[] firstBlock = Arrays.copyOfRange(firstPage, 52, pageOffset);
|
byte[] firstBlock = Arrays.copyOfRange(firstPage, 52, pageOffset);
|
||||||
if (panelType != PanelType.EVO192) {
|
if (!PanelType.isBigRamEvo(panelType)) {
|
||||||
result.setZonesLowBattery(firstBlock);
|
result.setZonesLowBattery(firstBlock);
|
||||||
} else {
|
} else {
|
||||||
byte[] secondBlock = Arrays.copyOfRange(secondPage, 24, 36);
|
byte[] secondBlock = Arrays.copyOfRange(secondPage, 24, 36);
|
||||||
|
@ -59,6 +59,10 @@ public enum PanelType {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isBigRamEvo(PanelType panelType) {
|
||||||
|
return panelType == EVO192 || panelType == EVOHD;
|
||||||
|
}
|
||||||
|
|
||||||
public int getPartitions() {
|
public int getPartitions() {
|
||||||
return partitions;
|
return partitions;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user