-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[VeSync] Add support for wifi outlets (#17844)
* Add support for wifi outlets Signed-off-by: Marcel Goerentz <[email protected]>
- Loading branch information
1 parent
f78c618
commit 65664f2
Showing
15 changed files
with
614 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
...n/java/org/openhab/binding/vesync/internal/dto/requests/VeSyncRequestGetOutletStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.vesync.internal.dto.requests; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* The {@link VeSyncRequestGetOutletStatus} is a Java class used as a DTO to hold the Vesync's API's common | ||
* request data for V2 ByPass payloads. | ||
* | ||
* @author Marcel Goerentz - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class VeSyncRequestGetOutletStatus extends VeSyncRequest { | ||
|
||
@SerializedName("cid") | ||
public String cid = ""; | ||
|
||
@SerializedName("configModule") | ||
public String configModule = ""; | ||
|
||
@SerializedName("debugMode") | ||
public boolean debugMode = false; | ||
|
||
@SerializedName("subDeviceNo") | ||
public int subDeviceNo = 0; | ||
|
||
@SerializedName("token") | ||
public String token = ""; | ||
|
||
@SerializedName("userCountryCode") | ||
public String userCountryCode = ""; | ||
|
||
@SerializedName("deviceId") | ||
public String deviceId = ""; | ||
|
||
@SerializedName("configModel") | ||
public String configModel = ""; | ||
|
||
@SerializedName("payload") | ||
public Payload payload = new Payload(); | ||
|
||
public class Payload { | ||
|
||
@SerializedName("data") | ||
public Data data = new Data(); | ||
|
||
// Empty class | ||
public class Data { | ||
} | ||
|
||
@SerializedName("method") | ||
public String method = ""; | ||
|
||
@SerializedName("subDeviceNo") | ||
public int subDeviceNo = 0; | ||
|
||
@SerializedName("source") | ||
public String source = "APP"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
...n/java/org/openhab/binding/vesync/internal/dto/responses/VeSyncV2BypassEnergyHistory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/** | ||
* Copyright (c) 2010-2024 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.vesync.internal.dto.responses; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* The {@link VeSyncV2BypassEnergyHistory} is a Java class used as a DTO to hold the Vesync's API's common response | ||
* data, in regard to an outlet device. | ||
* | ||
* @author Marcel Goerentz - Initial contribution | ||
*/ | ||
public class VeSyncV2BypassEnergyHistory extends VeSyncResponse { | ||
|
||
@SerializedName("result") | ||
public EnergyHistory result; | ||
|
||
public class EnergyHistory extends VeSyncResponse { | ||
|
||
@SerializedName("result") | ||
public Result result = new Result(); | ||
|
||
public class Result { | ||
|
||
@SerializedName("energyInfos") | ||
public List<EnergyInfo> energyInfos = new ArrayList<EnergyInfo>(); | ||
|
||
public class EnergyInfo { | ||
|
||
@SerializedName("timestamp") | ||
public long timestamp = 0; | ||
|
||
@SerializedName("energy") | ||
public double energy = 0.00; | ||
} | ||
|
||
@SerializedName("total") | ||
public int total = 0; | ||
} | ||
} | ||
} |
Oops, something went wrong.