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.vesync.internal.dto.requests;
15 import com.google.gson.annotations.SerializedName;
18 * The {@link VeSyncRequestManagedDeviceBypassV2} is a Java class used as a DTO to hold the Vesync's API's common
19 * request data for V2 ByPass payloads.
21 * @author David Goodyear - Initial contribution
23 public class VeSyncRequestManagedDeviceBypassV2 extends VeSyncAuthenticatedRequest {
25 @SerializedName("deviceRegion")
26 public String deviceRegion = "";
28 @SerializedName("debugMode")
29 public boolean debugMode = false;
31 @SerializedName("cid")
32 public String cid = "";
34 @SerializedName("configModule")
35 public String configModule = "";
37 @SerializedName("payload")
38 public VesyncManagedDeviceBase payload = new VesyncManagedDeviceBase();
41 * Contains basic information about the device.
43 public class VesyncManagedDeviceBase {
45 @SerializedName("method")
48 @SerializedName("source")
49 public String source = "APP";
51 @SerializedName("data")
52 public EmptyPayload data = new EmptyPayload();
55 public static class EmptyPayload {
58 public static class SetSwitchPayload extends EmptyPayload {
60 public SetSwitchPayload(final boolean enabled, final int id) {
61 this.enabled = enabled;
65 @SerializedName("enabled")
66 public boolean enabled = true;
72 public static class EnabledPayload extends EmptyPayload {
74 public EnabledPayload(final boolean enabled) {
75 this.enabled = enabled;
78 @SerializedName("enabled")
79 public boolean enabled = true;
82 public static class SetLevelPayload extends EmptyPayload {
84 public SetLevelPayload(final int id, final String type, final int level) {
93 @SerializedName("level")
94 public int level = -1;
96 @SerializedName("type")
97 public String type = "";
100 public static class SetState extends EmptyPayload {
102 public SetState(final boolean state) {
106 @SerializedName("state")
107 public boolean state = false;
110 public static class SetNightLight extends EmptyPayload {
112 public SetNightLight(final String state) {
113 this.nightLight = state;
116 @SerializedName("night_light")
117 public String nightLight = "";
120 public static class SetNightLightBrightness extends EmptyPayload {
122 public SetNightLightBrightness(final int state) {
123 this.nightLightLevel = state;
126 @SerializedName("night_light_brightness")
127 public int nightLightLevel = 0;
130 public static class SetTargetHumidity extends EmptyPayload {
132 public SetTargetHumidity(final int state) {
133 this.targetHumidity = state;
136 @SerializedName("target_humidity")
137 public int targetHumidity = 0;
140 public static class SetChildLock extends EmptyPayload {
142 public SetChildLock(final boolean childLock) {
143 this.childLock = childLock;
146 @SerializedName("child_lock")
147 public boolean childLock = false;
150 public static class SetMode extends EmptyPayload {
152 public SetMode(final String mode) {
156 @SerializedName("mode")
157 public String mode = "";
160 public VeSyncRequestManagedDeviceBypassV2() {