]> git.basschouten.com Git - openhab-addons.git/blob
8f76f4d143ac519693252140c7de162561731e84
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2022 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.bondhome.internal.api;
14
15 import static org.openhab.binding.bondhome.internal.BondHomeBindingConstants.*;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 import com.google.gson.annotations.Expose;
21 import com.google.gson.annotations.SerializedName;
22
23 /**
24  * This POJO represents update datagram sent by the Bond Push UDP Protocol
25  *
26  * The incoming JSON looks like this:
27  *
28  * {"B": "ZZBL12345", "t": "devices/aabbccdd/state", "i": "00112233bbeeeeff", "s" :200, "m": 0, "f": 255, "b": {"_":
29  * "ab9284ef", "power": 1, "speed": 2}}
30  *
31  * @author Sara Geleskie Damiano - Initial contribution
32  */
33 @NonNullByDefault
34 public class BPUPUpdate {
35     // The Bond ID
36     @SerializedName("B")
37     @Expose(serialize = true, deserialize = true)
38     public @Nullable String bondId;
39     // The topic (the path from HTTP URL)
40     @SerializedName("t")
41     @Expose(serialize = true, deserialize = true)
42     public @Nullable String topic;
43     // The request ID
44     @SerializedName("i")
45     @Expose(serialize = true, deserialize = true)
46     public @Nullable String requestId;
47     // The HTTP status code
48     @SerializedName("s")
49     @Expose(serialize = true, deserialize = true)
50     public int statusCode;
51     // HTTP method (0=GET, 1=POST, 2=PUT, 3=DELETE, 4=PATCH)
52     @SerializedName("m")
53     @Expose(serialize = true, deserialize = true)
54     public int method;
55     // flags (Olibra-internal use)
56     @SerializedName("f")
57     @Expose(serialize = true, deserialize = true)
58     public int flag;
59     // HTTP response body
60     @SerializedName("b")
61     @Expose(serialize = true, deserialize = true)
62     public @Nullable BondDeviceState deviceState;
63 }