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.bondhome.internal.api;
15 import java.util.Arrays;
16 import java.util.List;
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
21 import com.google.gson.annotations.Expose;
22 import com.google.gson.annotations.SerializedName;
25 * This POJO represents a bond device
27 * The incoming JSON looks like this:
29 * {"name": "My Fan", "type": "CF", "template": "A1", "location": "Kitchen",
30 * "actions": {"_": "7fc1e84b"}, "properties": {"_": "84cd8a43"}, "state": {"_":
31 * "ad9bcde4"}, "commands": {"_": "ad9bcde4" }}
33 * @author Sara Geleskie Damiano - Initial contribution
36 public class BondDevice {
37 // The current device hash
39 @Expose(serialize = false, deserialize = true)
40 public @Nullable String hash;
41 // The name associated with the device in the bond app
42 @Expose(serialize = true, deserialize = true)
43 public @Nullable String name;
45 @Expose(serialize = true, deserialize = true)
46 public BondDeviceType type = BondDeviceType.GENERIC_DEVICE;
47 // The remote control template being used
48 @Expose(serialize = true, deserialize = true)
49 public @Nullable String template;
50 // A list of the available actions
51 @Expose(serialize = false, deserialize = true)
52 public List<BondDeviceAction> actions = Arrays.asList(BondDeviceAction.TURN_ON);
53 // The current hash of the properties object
54 @Expose(serialize = false, deserialize = true)
55 public @Nullable BondHash properties;
56 // The current hash of the state object
57 @Expose(serialize = false, deserialize = true)
58 public @Nullable BondHash state;
59 // The current hash of the commands object - only applies to a bridge
60 @Expose(serialize = false, deserialize = true)
61 public @Nullable BondHash commands;