]> git.basschouten.com Git - openhab-addons.git/blob
892182d70ade4c5df05d1d8773ec05176d7ccbef
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.pilight.internal.types;
14
15 import org.openhab.core.library.types.OpenClosedType;
16
17 /**
18  * Enum to represent the state of a contact sensor in pilight
19  *
20  * @author Jeroen Idserda - Initial contribution
21  * @author Stefan Röllin - Port to openHAB 2 pilight binding
22  * @author Niklas Dörfler - Port pilight binding to openHAB 3 + add device discovery
23  */
24 public enum PilightContactType {
25     OPENED,
26     CLOSED;
27
28     public OpenClosedType toOpenClosedType() {
29         return this.equals(PilightContactType.OPENED) ? OpenClosedType.OPEN : OpenClosedType.CLOSED;
30     }
31 }