2 * Copyright (c) 2010-2024 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.homewizard.internal;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
17 import com.google.gson.annotations.SerializedName;
20 * Class that provides storage for the json object obtained from the HomeWizard device State API
22 * @author Daniƫl van Os - Initial contribution
26 public class StatePayload {
27 @SerializedName("power_on")
28 private boolean powerOn;
29 @SerializedName("switch_lock")
30 private boolean switchLock;
31 private int brightness = 0;
34 * Getter for the power_on field
36 * @return true if the device is currently on, false if it is off
38 public boolean getPowerOn() {
43 * Setter for the power_on field
45 * @param powerOn true to turn the device on, false to turn it off
47 public void setPowerOn(boolean powerOn) {
48 this.powerOn = powerOn;
52 * Getter for the switch_lock field
54 * @return true if the device currently locked, false if it is not
56 public boolean getSwitchLock() {
61 * Setter for the power_on field
63 * @param switchLock true to lock the device, false to unlock it
65 public void setSwitchLock(boolean switchLock) {
66 this.switchLock = switchLock;
70 * Getter for the ring brightness
72 * @return ring brightness percentage
74 public int getBrightness() {
79 * Setter for the ring brightness
81 * @param brightness ring brightness
83 public void setBrightness(int brightness) {
84 this.brightness = brightness;
88 public String toString() {
89 return String.format("State [power_on: %b switch_lock: %b brightness: %d]", powerOn, switchLock, brightness);