2 * Copyright (c) 2010-2022 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.binding.pilight.internal.types;
15 import org.openhab.core.library.types.OpenClosedType;
18 * Enum to represent the state of a contact sensor in pilight
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
24 public enum PilightContactType {
28 public OpenClosedType toOpenClosedType() {
29 return this.equals(PilightContactType.OPENED) ? OpenClosedType.OPEN : OpenClosedType.CLOSED;