2 * Copyright (c) 2010-2023 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.miio.internal.basic;
15 import java.util.ArrayList;
16 import java.util.List;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20 import org.openhab.binding.miio.internal.MiIoCommand;
22 import com.google.gson.annotations.Expose;
23 import com.google.gson.annotations.SerializedName;
26 * Mapping devices from json
28 * @author Marcel Verpaalen - Initial contribution
31 public class DeviceMapping {
35 private List<String> id = new ArrayList<>();
36 @SerializedName("propertyMethod")
38 private @Nullable String propertyMethod;
39 @SerializedName("maxProperties")
41 private @Nullable Integer maxProperties;
42 @SerializedName("channels")
44 private List<MiIoBasicChannel> miIoBasicChannels = new ArrayList<>();
45 @SerializedName("readmeComment")
47 private @Nullable String readmeComment;
48 @SerializedName("experimental")
50 private @Nullable Boolean experimental;
52 public List<String> getId() {
56 public void setId(List<String> id) {
60 public String getPropertyMethod() {
61 final String propertyMethod = this.propertyMethod;
62 return propertyMethod != null ? propertyMethod : MiIoCommand.GET_PROPERTY.getCommand();
65 public void setPropertyMethod(String propertyMethod) {
66 this.propertyMethod = propertyMethod;
69 public int getMaxProperties() {
70 final Integer maxProperties = this.maxProperties;
71 return maxProperties != null ? maxProperties.intValue() : 5;
74 public void setMaxProperties(int maxProperties) {
75 this.maxProperties = maxProperties;
78 public List<MiIoBasicChannel> getChannels() {
79 return miIoBasicChannels;
82 public void setChannels(List<MiIoBasicChannel> miIoBasicChannels) {
83 this.miIoBasicChannels = miIoBasicChannels;
86 public String getReadmeComment() {
87 final String readmeComment = this.readmeComment;
88 return (readmeComment != null) ? readmeComment : "";
91 public void setReadmeComment(String readmeComment) {
92 this.readmeComment = readmeComment;
95 public @Nullable Boolean getExperimental() {
99 public void setExperimental(Boolean experimental) {
100 this.experimental = experimental;