]> git.basschouten.com Git - openhab-addons.git/blob
d5d3e722895cbe8e90d7aebb8c17206978631ea9
[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 import java.util.BitSet;
16
17 /**
18  * Available door control types.
19  *
20  * @author Krzysztof Goworek - Initial contribution
21  */
22 public enum DoorControl implements ControlType {
23     OPEN(0x8A, DoorState.OPENED);
24
25     private byte controlCommand;
26     private BitSet stateBits;
27
28     DoorControl(int controlCommand, DoorState... controlledStates) {
29         this.controlCommand = (byte) controlCommand;
30         this.stateBits = StateType.getStatesBitSet(controlledStates);
31     }
32
33     @Override
34     public byte getControlCommand() {
35         return controlCommand;
36     }
37
38     @Override
39     public ObjectType getObjectType() {
40         return ObjectType.DOOR;
41     }
42
43     @Override
44     public BitSet getControlledStates() {
45         return stateBits;
46     }
47 }