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