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 org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
18 import com.google.gson.annotations.Expose;
19 import com.google.gson.annotations.SerializedName;
22 * This POJO represents the Bond Device state
24 * The incoming JSON looks like this:
26 * { "breeze": [ 1, 0.2, 0.9 ], "brightness": 75, "light": 1, "power": 0,
27 * "speed": 2, "timer": 3599 }
29 * @author Sara Geleskie Damiano - Initial contribution
32 public class BondDeviceState {
33 // The current state hash
35 @Expose(serialize = false, deserialize = true)
36 public @Nullable String hash;
38 // The device power state 1 = on, 0 = off
39 @Expose(serialize = true, deserialize = true)
42 // The seconds remaining on timer, or 0 meaning no timer running
43 @Expose(serialize = true, deserialize = true)
46 // The fan speed - value from 1 to max_speed. If power=0, speed represents the
47 // last speed setting and the speed to which the device resumes when user asks
49 @Expose(serialize = true, deserialize = true)
52 // The current breeze setting (for a ceiling fan)
53 // array of the form[<mode>,<mean>,<var>]:
54 // mode: (integer) 0 = breeze mode disabled, 1 = breeze mode enabled
55 // mean: (integer) sets the average speed. 0 = minimum average speed (calm), 100 = maximum average speed (storm)
56 // var: (integer) sets the variability of the speed. 0 = minimum variation (steady), 100 = maximum variation (gusty)
57 @Expose(serialize = true, deserialize = true)
58 public int[] breeze = { 0, 50, 50 };
60 // The direction of a fan with a reversible motor 1 = forward, -1 = reverse.
61 // The forward and reverse modes are sometimes called Summer and Winter, respectively.
62 @Expose(serialize = true, deserialize = true)
65 // The fan light state 1 = light on, 0 = light off
66 @Expose(serialize = true, deserialize = true)
69 // Whether separate up and down lights are enabled, if applicable
70 // 1 = enabled, 0 = disabled
71 // If both up_light and light are 1, then the up light will be on, and similar for down light.
72 @SerializedName("up_light")
73 @Expose(serialize = true, deserialize = true)
76 @SerializedName("down_light")
77 @Expose(serialize = true, deserialize = true)
80 // The brightness of a fan light or lights
81 @Expose(serialize = true, deserialize = true)
82 public int brightness;
84 @Expose(serialize = true, deserialize = true)
85 public int upLightBrightness;
87 @Expose(serialize = true, deserialize = true)
88 public int downLightBrightness;
90 // The flame level of a fireplace - value from 1 to 100. If power=0, flame represents the last flame setting and
91 // the flame to which the device resumes when user asks to turn on
92 @Expose(serialize = true, deserialize = true)
95 // Whether a device is open or closed (for motorized shades and garage doors)
96 // 1 = open, 0 = closed
97 @Expose(serialize = true, deserialize = true)
100 // Fan settings for a fireplace fan
101 // fpfan_power: (integer) 1 = on, 0 = off
102 // fpfan_speed: (integer) from 1-100
103 @SerializedName("fpfan_power")
104 @Expose(serialize = true, deserialize = true)
105 public int fpfanPower;
107 @SerializedName("fpfan_speed")
108 @Expose(serialize = true, deserialize = true)
109 public int fpfanSpeed;