2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.satel.internal.types;
18 * @author Krzysztof Goworek - Initial contribution
20 public enum TroubleState implements StateType {
22 TECHNICAL_ZONE(0x1b, 47, 0, 16),
23 EXPANDER_AC(0x1b, 47, 16, 8),
24 EXPANDER_BATT(0x1b, 47, 24, 8),
25 EXPANDER_NOBATT(0x1b, 47, 32, 8),
26 SYSTEM(0x1b, 47, 40, 3),
27 PTSA_AC(0x1b, 47, 43, 1),
28 PTSA_BATT(0x1b, 47, 44, 1),
29 PTSA_NOBATT(0x1b, 47, 45, 1),
30 ETHM1(0x1b, 47, 46, 1),
32 PROXIMITY_A(0x1c, 26, 0, 8),
33 PROXIMITY_B(0x1c, 26, 8, 8),
34 EXPANDER_OVERLOAD(0x1c, 26, 16, 8),
35 JAMMED_ACU100(0x1c, 26, 24, 2),
37 DEVICE_LOBATT(0x1d, 60, 15, 15),
38 DEVICE_NOCOMM(0x1d, 60, 30, 15),
39 OUTPUT_NOCOMM(0x1d, 60, 45, 15),
41 EXPANDER_NOCOMM(0x1e, 30, 0, 8),
42 EXPANDER_SWITCHEROOED(0x1e, 30, 8, 8),
43 KEYPAD_NOCOMM(0x1e, 30, 16, 1),
44 KEYPAD_SWITCHEROOED(0x1e, 30, 17, 1),
45 ETHM1_NOLAN(0x1e, 30, 18, 1),
46 EXPANDER_TAMPER(0x1e, 30, 19, 8),
47 KEYPAD_TAMPER(0x1e, 30, 27, 1),
48 KEYPAD_INIT(0x1e, 30, 28, 1),
49 AUXILIARY_STM(0x1e, 30, 29, 1),
51 MASTER_KEYFOB(0x1f, 31, 0, 1),
52 USER_KEYFOB(0x1f, 31, 1, 30),
54 DEVICE_LOBATT1(0x2c, 45, 0, 15),
55 DEVICE_NOCOMM1(0x2c, 45, 15, 15),
56 OUTPUT_NOCOMM1(0x2c, 45, 30, 15),
58 TECHNICAL_ZONE1(0x2d, 47, 0, 16),;
60 private byte refreshCommand;
61 private int payloadLength;
62 private int startByte;
63 private int bytesCount;
65 TroubleState(int refreshCommand, int payloadLength, int startByte, int bytesCount) {
66 this.refreshCommand = (byte) refreshCommand;
67 this.payloadLength = payloadLength;
68 this.startByte = startByte;
69 this.bytesCount = bytesCount;
73 public byte getRefreshCommand() {
74 return refreshCommand;
78 public int getPayloadLength(boolean extendedCmd) {
83 public ObjectType getObjectType() {
84 return ObjectType.TROUBLE;
88 public int getStartByte() {
93 public int getBytesCount(boolean isExtended) {