]> git.basschouten.com Git - openhab-addons.git/blob
7bf51fbc56819e7e525e9a83853dcb8fb96797ce
[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.km200.internal;
14
15 import java.util.ArrayList;
16 import java.util.Collections;
17 import java.util.List;
18
19 import org.openhab.core.thing.ThingTypeUID;
20
21 /**
22  * The KM200ThingType enum is representing the things
23  *
24  * @author Markus Eckhardt - Initial contribution
25  *
26  */
27 public enum KM200ThingType {
28     GATEWAY("/gateway", KM200BindingConstants.THING_TYPE_GATEWAY) {
29         @Override
30         public List<String> asBridgeProperties() {
31             List<String> asProperties = new ArrayList<>();
32             asProperties.add("versionFirmware");
33             asProperties.add("instAccess");
34             asProperties.add("versionHardware");
35             asProperties.add("uuid");
36             asProperties.add("instWriteAccess");
37             asProperties.add("openIPAccess");
38             return asProperties;
39         }
40     },
41
42     DHWCIRCUIT("/dhwCircuits", KM200BindingConstants.THING_TYPE_DHW_CIRCUIT) {
43         @Override
44         public List<String> ignoreSubService() {
45             List<String> subServices = new ArrayList<>();
46             subServices.add("switchPrograms");
47             return subServices;
48         }
49
50         @Override
51         public String getActiveCheckSubPath() {
52             return "status";
53         }
54     },
55
56     HEATINGCIRCUIT("/heatingCircuits", KM200BindingConstants.THING_TYPE_HEATING_CIRCUIT) {
57         @Override
58         public List<String> ignoreSubService() {
59             List<String> subServices = new ArrayList<>();
60             subServices.add("switchPrograms");
61             return subServices;
62         }
63
64         @Override
65         public String getActiveCheckSubPath() {
66             return "status";
67         }
68     },
69
70     HEATSOURCE("/heatSources", KM200BindingConstants.THING_TYPE_HEAT_SOURCE),
71
72     SOLARCIRCUIT("/solarCircuits", KM200BindingConstants.THING_TYPE_SOLAR_CIRCUIT) {
73         @Override
74         public String getActiveCheckSubPath() {
75             return "status";
76         }
77     },
78
79     APPLIANCE("/system/appliance", KM200BindingConstants.THING_TYPE_SYSTEM_APPLIANCE),
80
81     HOLIDAYMODES("/system/holidayModes", KM200BindingConstants.THING_TYPE_SYSTEM_HOLIDAYMODES),
82
83     NOTIFICATIONS("/notifications", KM200BindingConstants.THING_TYPE_NOTIFICATION),
84
85     SENSOR("/system/sensors", KM200BindingConstants.THING_TYPE_SYSTEM_SENSOR),
86
87     SYSTEM("/system", KM200BindingConstants.THING_TYPE_SYSTEM) {
88         @Override
89         public List<String> ignoreSubService() {
90             List<String> subServices = new ArrayList<>();
91             subServices.add("sensors");
92             subServices.add("appliance");
93             subServices.add("holidayModes");
94             return subServices;
95         }
96
97         @Override
98         public List<String> asBridgeProperties() {
99             List<String> asProperties = new ArrayList<>();
100             asProperties.add("bus");
101             asProperties.add("systemType");
102             asProperties.add("brand");
103             asProperties.add("info");
104             return asProperties;
105         }
106     },
107
108     SWITCHPROGRAM("", KM200BindingConstants.THING_TYPE_SWITCH_PROGRAM),
109
110     SYSTEMSTATES("/systemStates", KM200BindingConstants.THING_TYPE_SYSTEMSTATES);
111
112     public final String rootPath;
113
114     public final ThingTypeUID thingTypeUID;
115
116     KM200ThingType(String rootPath, ThingTypeUID thingTypeUID) {
117         this.rootPath = rootPath;
118         this.thingTypeUID = thingTypeUID;
119     }
120
121     public String getRootPath() {
122         return rootPath;
123     }
124
125     public ThingTypeUID getThingTypeUID() {
126         return thingTypeUID;
127     }
128
129     public List<String> ignoreSubService() {
130         return Collections.emptyList();
131     }
132
133     public String getActiveCheckSubPath() {
134         return null;
135     }
136
137     public List<String> asBridgeProperties() {
138         return Collections.emptyList();
139     }
140 }