forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[evcc] Adjust to evcc 0.125.0 API changes (openhab#16660)
* avoid deprecated parameters evcc rest API parameters 'batteryConfigured' and 'pvConfigured' Signed-off-by: Michael Weger <[email protected]>
- Loading branch information
1 parent
a7d0ad1
commit fc1a100
Showing
5 changed files
with
146 additions
and
28 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
69 changes: 69 additions & 0 deletions
69
...openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/dto/Battery.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,69 @@ | ||
/** | ||
* 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.evcc.internal.api.dto; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* This class represents a battery object of the status response (/api/state). | ||
* This DTO was written for evcc version 0.123.1 | ||
* | ||
* @author MikeTheTux - Initial contribution | ||
*/ | ||
public class Battery { | ||
// Data types from https://github.com/evcc-io/evcc/blob/master/api/api.go | ||
// and from https://docs.evcc.io/docs/reference/configuration/messaging/#msg | ||
|
||
@SerializedName("power") | ||
private float power; | ||
|
||
@SerializedName("energy") | ||
private float energy; | ||
|
||
@SerializedName("soc") | ||
private float soc; | ||
|
||
@SerializedName("capacity") | ||
private float capacity; | ||
|
||
@SerializedName("controllable") | ||
private boolean controllable; | ||
|
||
/** | ||
* @return battery's capacity | ||
*/ | ||
public float getCapacity() { | ||
return capacity; | ||
} | ||
|
||
/** | ||
* @return battery's power | ||
*/ | ||
public float getPower() { | ||
return power; | ||
} | ||
|
||
/** | ||
* @return battery's state of charge | ||
*/ | ||
public float getSoC() { | ||
return soc; | ||
} | ||
|
||
/** | ||
* @return battery discharge controlable | ||
*/ | ||
public boolean getControllable() { | ||
return controllable; | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
.../org.openhab.binding.evcc/src/main/java/org/openhab/binding/evcc/internal/api/dto/PV.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,36 @@ | ||
/** | ||
* 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.evcc.internal.api.dto; | ||
|
||
import com.google.gson.annotations.SerializedName; | ||
|
||
/** | ||
* This class represents a PV object of the status response (/api/state). | ||
* This DTO was written for evcc version 0.123.1 | ||
* | ||
* @author MikeTheTux - Initial contribution | ||
*/ | ||
public class PV { | ||
// Data types from https://github.com/evcc-io/evcc/blob/master/api/api.go | ||
// and from https://docs.evcc.io/docs/reference/configuration/messaging/#msg | ||
|
||
@SerializedName("power") | ||
private float power; | ||
|
||
/** | ||
* @return PV power | ||
*/ | ||
public float getPower() { | ||
return power; | ||
} | ||
} |
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