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.konnected.internal.gson;
15 import static org.openhab.binding.konnected.internal.KonnectedBindingConstants.*;
17 import com.google.gson.annotations.SerializedName;
20 * The {@link KonnectedModuleGson} is responsible to hold
21 * data that models pin information which can be sent to a Konnected Module
23 * @author Zachary Christiansen - Initial contribution
26 public class KonnectedModuleGson {
32 private Integer state;
33 @SerializedName("Auth_Token")
34 private String authToken;
35 private Integer momentary;
36 private Integer pause;
37 private Integer times;
38 @SerializedName("poll_interval")
39 private Integer pollInterval;
42 public Integer getPin() {
46 public void setPin(Integer pin) {
50 public String getZone() {
54 public void setZone(String zone) {
58 public Integer getPollInterval() {
62 public void setPollInterval(Integer setPollInterval) {
63 this.pollInterval = setPollInterval;
66 public String getTemp() {
70 public void setTemp(String setTemp) {
74 public String getHumi() {
78 public void setHumi(String setHumi) {
82 public Integer getState() {
86 public void setState(Integer setState) {
87 this.state = setState;
90 public String getAuthToken() {
94 public Integer getMomentary() {
98 public void setMomentary(Integer setMomentary) {
99 this.momentary = setMomentary;
102 public Integer getPause() {
106 public void setPause(Integer setPause) {
107 this.pause = setPause;
110 public Integer getTimes() {
114 public void setTimes(Integer setTimes) {
115 this.times = setTimes;
118 public String getAddr() {
122 public void setAddr(String setAddr) {
126 public void setZone(String thingId, String zone) {
127 if (isEsp8266(thingId)) {
128 setPin(ESP8266_ZONE_TO_PIN.get(zone));
134 public String getZone(String thingId) {
135 return isEsp8266(thingId) ? ESP8266_PIN_TO_ZONE.get(pin) : getZone();
138 private boolean isEsp8266(String thingId) {
139 return WIFI_MODULE.equals(thingId);