]> git.basschouten.com Git - openhab-addons.git/blob
ef98477935eb0f7238a3565b4a6257a6c5bf8221
[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 door states.
17  *
18  * @author Krzysztof Goworek - Initial contribution
19  */
20 public enum DoorState implements StateType {
21     OPENED(0x18),
22     OPENED_LONG(0x19);
23
24     private byte refreshCommand;
25
26     DoorState(int refreshCommand) {
27         this.refreshCommand = (byte) refreshCommand;
28     }
29
30     @Override
31     public byte getRefreshCommand() {
32         return refreshCommand;
33     }
34
35     @Override
36     public int getPayloadLength(boolean extendedCmd) {
37         return 8;
38     }
39
40     @Override
41     public ObjectType getObjectType() {
42         return ObjectType.DOOR;
43     }
44
45     @Override
46     public int getStartByte() {
47         return 0;
48     }
49
50     @Override
51     public int getBytesCount(boolean extendedCmd) {
52         return getPayloadLength(extendedCmd);
53     }
54 }