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