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.surepetcare.internal.dto;
15 import java.util.List;
17 import org.openhab.binding.surepetcare.internal.utils.SurePetcareDeviceCurfewListTypeAdapterFactory;
19 import com.google.gson.annotations.JsonAdapter;
20 import com.google.gson.annotations.SerializedName;
23 * The {@link SurePetcareDeviceControl} class is used to serialize a JSON object to control certain parameters of a
24 * device (e.g. locking mode, curfew etc.).
26 * @author Rene Scherer - Initial contribution
27 * @author Holger Eisold - Added pet feeder status
29 public class SurePetcareDeviceControl {
31 @SerializedName("locking")
32 public Integer lockingModeId;
33 public Boolean fastPolling;
34 @SerializedName("led_mode")
35 public Integer ledModeId;
36 @SerializedName("pairing_mode")
37 public Integer pairingModeId;
40 @SerializedName("training_mode")
41 public Integer trainingModeId;
42 @SerializedName("curfew")
43 @JsonAdapter(SurePetcareDeviceCurfewListTypeAdapterFactory.class)
44 public SurePetcareDeviceCurfewList curfewList;
47 public class BowlSettings {
48 @SerializedName("food_type")
49 public Integer foodId;
50 @SerializedName("target")
51 public Integer targetId;
53 public BowlSettings(Integer foodId, Integer targetId) {
55 this.targetId = targetId;
59 @SerializedName("settings")
60 public List<BowlSettings> bowlSettings;
61 @SerializedName("type")
62 public Integer bowlId;
64 public Bowls(List<BowlSettings> bowlSettings, Integer bowlId) {
65 this.bowlSettings = bowlSettings;
71 @SerializedName("close_delay")
72 public Integer closeDelayId;
74 public Lid(Integer closeDelayId) {
75 this.closeDelayId = closeDelayId;
80 public String toString() {
81 StringBuilder builder = new StringBuilder("SurePetcareDeviceControl [");
82 builder.append("lockingModeId=").append(lockingModeId);
83 builder.append(", fastPolling=").append(fastPolling);
84 builder.append(", ledModeId=").append(ledModeId);
85 builder.append(", pairingModeId=").append(pairingModeId);
86 builder.append(", trainingModeId=").append(trainingModeId);
87 builder.append(", curfew=").append(curfewList);
88 return builder.toString();