]> git.basschouten.com Git - openhab-addons.git/blob
60ef8ea9ca183b94deca5df5aa7d1d11a2f643d8
[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 zone control types.
19  *
20  * @author Krzysztof Goworek - Initial contribution
21  */
22 public enum ZoneControl implements ControlType {
23     BYPASS(0x86, ZoneState.BYPASS),
24     UNBYPASS(0x87, ZoneState.BYPASS),
25     ISOLATE(0x90, ZoneState.ISOLATE);
26
27     private byte controlCommand;
28     private BitSet stateBits;
29
30     ZoneControl(int controlCommand, ZoneState... controlledStates) {
31         this.controlCommand = (byte) controlCommand;
32         this.stateBits = StateType.getStatesBitSet(controlledStates);
33     }
34
35     @Override
36     public byte getControlCommand() {
37         return controlCommand;
38     }
39
40     @Override
41     public ObjectType getObjectType() {
42         return ObjectType.ZONE;
43     }
44
45     @Override
46     public BitSet getControlledStates() {
47         return stateBits;
48     }
49 }