]> git.basschouten.com Git - openhab-addons.git/blob
8d4692c89cfd34db356f9d3ec82d4b2549206d0b
[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.lutron.internal.discovery.project;
14
15 import java.util.Collections;
16 import java.util.List;
17
18 /**
19  * An input device in a Lutron system such as a keypad or occupancy sensor.
20  *
21  * @author Allan Tong - Initial contribution
22  */
23 public class Device implements DeviceNode {
24     private String name;
25     private Integer integrationId;
26     private String type;
27     private List<Component> components;
28
29     public String getName() {
30         return name;
31     }
32
33     public Integer getIntegrationId() {
34         return integrationId;
35     }
36
37     public String getType() {
38         return type;
39     }
40
41     public DeviceType getDeviceType() {
42         try {
43             return DeviceType.valueOf(this.type);
44         } catch (Exception e) {
45             return null;
46         }
47     }
48
49     public List<Component> getComponents() {
50         return components != null ? components : Collections.<Component> emptyList();
51     }
52 }