Site: add returnEnergy to aggregated battery state (#33241)
Co-authored-by: claude[bot] <41898282+claude[bot]@users.noreply.github.com> Co-authored-by: Michael Geers <michael@geers.tv>
This commit is contained in:
parent
8ccd72e141
commit
ea8e2a72c0
6 changed files with 27 additions and 11 deletions
6
server/mcp/openapi.json
generated
6
server/mcp/openapi.json
generated
|
|
@ -3843,7 +3843,11 @@
|
|||
"type": "number"
|
||||
},
|
||||
"energy": {
|
||||
"description": "Total battery energy in kWh.",
|
||||
"description": "Total discharged energy in kWh.",
|
||||
"type": "number"
|
||||
},
|
||||
"returnEnergy": {
|
||||
"description": "Total charged energy in kWh.",
|
||||
"type": "number"
|
||||
},
|
||||
"devices": {
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ func (suite *mqttSuite) TestMeasurement() {
|
|||
|
||||
func (suite *mqttSuite) TestBatteryState() {
|
||||
topics := lo.Map([]string{
|
||||
"power", "energy", "capacity", "soc",
|
||||
"power", "energy", "returnEnergy", "capacity", "soc",
|
||||
"devices", "devices/1/name", "devices/1/title", "devices/1/icon", "devices/1/power", "devices/1/energy", "devices/1/returnEnergy", "devices/1/powers", "devices/1/currents", "devices/1/excessDCPower", "devices/1/capacity", "devices/1/soc", "devices/1/controllable", "devices/1/suggestion",
|
||||
"forecast",
|
||||
}, func(s string, _ int) string {
|
||||
|
|
@ -169,5 +169,5 @@ func (suite *mqttSuite) TestBatteryState() {
|
|||
})
|
||||
|
||||
suite.Equal(topics, suite.topics, "topics")
|
||||
suite.Equal([]string{"2", "", "", "20", "1", "", "", "", "1", "", "", "", "", "", "", "10", "", "", ""}, suite.payloads, "payloads")
|
||||
suite.Equal([]string{"2", "", "", "", "20", "1", "", "", "", "1", "", "", "", "", "", "", "10", "", "", ""}, suite.payloads, "payloads")
|
||||
}
|
||||
|
|
|
|||
5
server/openapi.state.yaml
generated
5
server/openapi.state.yaml
generated
|
|
@ -302,7 +302,10 @@ components:
|
|||
description: Charge level in %. Weighted by capacity across all batteries.
|
||||
type: number
|
||||
energy:
|
||||
description: Total battery energy in kWh.
|
||||
description: Total discharged energy in kWh.
|
||||
type: number
|
||||
returnEnergy:
|
||||
description: Total charged energy in kWh.
|
||||
type: number
|
||||
devices:
|
||||
description: Measurement data per battery meter.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue