]> git.basschouten.com Git - openhab-addons.git/blob
23bdd4d4679465b63f0c62302aecd6f8afd0b531
[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.plugwise.internal.protocol.field;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16
17 /**
18  * Enumerates Plugwise devices.
19  *
20  * @author Wouter Born - Initial contribution
21  */
22 @NonNullByDefault
23 public enum DeviceType {
24
25     STICK("Stick", false, false),
26     CIRCLE("Circle", true, false),
27     CIRCLE_PLUS("Circle+", true, false),
28     SCAN("Scan", false, true),
29     SENSE("Sense", false, true),
30     STEALTH("Stealth", true, false),
31     SWITCH("Switch", false, true),
32     UNKNOWN("Unknown", false, false);
33
34     private final String string;
35     private final boolean relayDevice;
36     private final boolean sleepingEndDevice;
37
38     DeviceType(String string, boolean relayDevice, boolean sleepingEndDevice) {
39         this.string = string;
40         this.relayDevice = relayDevice;
41         this.sleepingEndDevice = sleepingEndDevice;
42     }
43
44     public boolean isRelayDevice() {
45         return relayDevice;
46     }
47
48     public boolean isSleepingEndDevice() {
49         return sleepingEndDevice;
50     }
51
52     @Override
53     public String toString() {
54         return string;
55     }
56 }