]> git.basschouten.com Git - openhab-addons.git/blob
12de70ce58f98411a8ff9bc7735b32cf75005ee1
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.satel.internal.types;
14
15 /**
16  * Available partition states.
17  *
18  * @author Krzysztof Goworek - Initial contribution
19  */
20 public enum PartitionState implements StateType {
21     ARMED(0x09),
22     REALLY_ARMED(0x0a),
23     ARMED_MODE_2(0x0b),
24     ARMED_MODE_3(0x0c),
25     FIRST_CODE_ENTERED(0x0d),
26     ENTRY_TIME(0x0e),
27     EXIT_TIME_GT_10(0x0f),
28     EXIT_TIME_LT_10(0x10),
29     TEMPORARY_BLOCKED(0x11),
30     BLOCKED_FOR_GUARD(0x12),
31     ALARM(0x13),
32     FIRE_ALARM(0x14),
33     ALARM_MEMORY(0x15),
34     FIRE_ALARM_MEMORY(0x16),
35     VIOLATED_ZONES(0x25),
36     VERIFIED_ALARMS(0x27),
37     ARMED_MODE_1(0x2a),
38     WARNING_ALARMS(0x2b);
39
40     private byte refreshCommand;
41
42     PartitionState(int refreshCommand) {
43         this.refreshCommand = (byte) refreshCommand;
44     }
45
46     @Override
47     public byte getRefreshCommand() {
48         return refreshCommand;
49     }
50
51     @Override
52     public int getPayloadLength(boolean extendedCmd) {
53         return 4;
54     }
55
56     @Override
57     public ObjectType getObjectType() {
58         return ObjectType.PARTITION;
59     }
60
61     @Override
62     public int getStartByte() {
63         return 0;
64     }
65
66     @Override
67     public int getBytesCount(boolean extendedCmd) {
68         return getPayloadLength(extendedCmd);
69     }
70 }