]> git.basschouten.com Git - openhab-addons.git/blob
c838438da2944e741b90fb46d7a07b31dbe50b23
[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.surepetcare.internal.dto;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * The {@link SurePetcareDeviceStatus} class is used to serialize a JSON object to report the status of a device (e.g.
19  * locking mode, LED mode etc.).
20  *
21  * @author Rene Scherer - Initial contribution
22  */
23 public class SurePetcareDeviceStatus {
24
25     @SerializedName("led_mode")
26     public Integer ledModeId;
27     @SerializedName("pairing_mode")
28     public Integer pairingModeId;
29     public Locking locking;
30     public Version version;
31     public Float battery;
32     // learn_mode - unknown type
33     public Boolean online;
34     public Signal signal = new Signal();
35
36     public SurePetcareDeviceStatus assign(SurePetcareDeviceStatus source) {
37         this.ledModeId = source.ledModeId;
38         this.pairingModeId = source.pairingModeId;
39         this.locking = source.locking;
40         this.version = source.version;
41         this.battery = source.battery;
42         this.online = source.online;
43         this.signal = source.signal;
44         return this;
45     }
46
47     public class Locking {
48         @SerializedName("mode")
49         public Integer modeId;
50     }
51
52     public class Version {
53         public class Device {
54             public String hardware;
55             public String firmware;
56         }
57
58         // for Cat flaps only
59         public Device device = new Device();
60         // for Pet flaps only
61         public Device lcd = new Device();
62         public Device rf = new Device();
63     }
64
65     public class Signal {
66         public Float deviceRssi;
67         public Float hubRssi;
68     }
69 }