Revert "API: generate /api/state documentation from UI types" (#32109)
This commit is contained in:
parent
cd9812ef14
commit
9c88523682
42 changed files with 3359 additions and 8732 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -216,13 +216,13 @@ Directly controls the mode of all controllable batteries. evcc behavior like 'pr
|
|||
|
||||
| Name | Type | Description |
|
||||
|------|------|-------------|
|
||||
| batteryMode | string | Battery operation mode. |
|
||||
| batteryMode | string | Battery mode |
|
||||
|
||||
**Example call:**
|
||||
|
||||
```json
|
||||
call setExternalBatteryMode {
|
||||
"batteryMode": "unknown"
|
||||
"batteryMode": "normal"
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -384,6 +384,26 @@ call setSolarAdjusted {
|
|||
}
|
||||
```
|
||||
|
||||
## getState
|
||||
|
||||
Returns the complete state of the system. This structure is used by the UI. It can be filtered by JQ to only return a subset of the data.
|
||||
|
||||
**Tags:** general
|
||||
|
||||
**Arguments:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|------|------|-------------|
|
||||
| jq | string | Filter the state with JQ |
|
||||
|
||||
**Example call:**
|
||||
|
||||
```json
|
||||
call getState {
|
||||
"jq": "example"
|
||||
}
|
||||
```
|
||||
|
||||
## removeGlobalSmartCostLimit
|
||||
|
||||
Convenience method to remove limit for all loadpoints at once. Value is applied to each individual loadpoint.
|
||||
|
|
@ -1146,26 +1166,6 @@ call updateSession {
|
|||
}
|
||||
```
|
||||
|
||||
## state
|
||||
|
||||
Returns the complete state of the system. This structure is used by the UI and also published via websocket and MQTT. It can be filtered by JQ to only return a subset of the data. Note: the response mirrors the internal UI state and carries no compatibility promise. Fields may change or disappear between releases.
|
||||
|
||||
**Tags:** state
|
||||
|
||||
**Arguments:**
|
||||
|
||||
| Name | Type | Description |
|
||||
|------|------|-------------|
|
||||
| jq | string | Filter the state with JQ |
|
||||
|
||||
**Example call:**
|
||||
|
||||
```json
|
||||
call state {
|
||||
"jq": "example"
|
||||
}
|
||||
```
|
||||
|
||||
## clearCache
|
||||
|
||||
Clears all cached data. This resets all cached values from tariffs, vehicle APIs, and other components that use caching.
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
package server
|
||||
|
||||
//go:generate go tool openapi-mcp --doc mcp/openapi.md mcp/openapi.json
|
||||
//go:generate go tool openapi openapi.yaml mcp/openapi.json
|
||||
//go:generate go tool openapi-mcp --doc mcp/openapi.md openapi.yaml
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -8,7 +8,6 @@ info:
|
|||
servers:
|
||||
- url: https://demo.evcc.io/api
|
||||
tags:
|
||||
- name: state
|
||||
- name: auth
|
||||
- name: battery
|
||||
- name: db
|
||||
|
|
@ -450,7 +449,7 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/ChargeMode"
|
||||
$ref: "#/components/schemas/Mode"
|
||||
/loadpoints/{id}/phases/{phases}:
|
||||
post:
|
||||
operationId: setLoadpointPhases
|
||||
|
|
@ -524,7 +523,7 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/StaticEnergyPlan"
|
||||
$ref: "#/components/schemas/StaticEnergyPlan"
|
||||
/loadpoints/{id}/plan/repeating/preview/{soc}/{weekdays}/{hourMinuteTime}/{timezone}:
|
||||
get:
|
||||
operationId: previewLoadpointRepeatingPlan
|
||||
|
|
@ -591,14 +590,14 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/PlanStrategy"
|
||||
$ref: "#/components/schemas/PlanStrategy"
|
||||
responses:
|
||||
200:
|
||||
"200":
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/PlanStrategy"
|
||||
$ref: "#/components/schemas/PlanStrategy"
|
||||
/loadpoints/{id}/priority/{priority}:
|
||||
post:
|
||||
operationId: setLoadpointPriority
|
||||
|
|
@ -946,13 +945,13 @@ paths:
|
|||
$ref: "#/components/responses/NumberResult"
|
||||
/state:
|
||||
get:
|
||||
operationId: state
|
||||
operationId: getState
|
||||
summary: System state
|
||||
description: "Returns the complete state of the system. This structure is used by the UI and also published via websocket and MQTT. It can be filtered by JQ to only return a subset of the data. Note: the response mirrors the internal UI state and carries no compatibility promise. Fields may change or disappear between releases."
|
||||
description: "Returns the complete state of the system. This structure is used by the UI. It can be filtered by JQ to only return a subset of the data."
|
||||
externalDocs:
|
||||
url: https://docs.evcc.io/integrations/rest-api
|
||||
tags:
|
||||
- state
|
||||
- general
|
||||
parameters:
|
||||
- name: jq
|
||||
in: query
|
||||
|
|
@ -972,7 +971,7 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/State"
|
||||
$ref: "#/components/schemas/State"
|
||||
/system/log:
|
||||
get:
|
||||
operationId: getSystemLogs
|
||||
|
|
@ -1165,7 +1164,7 @@ paths:
|
|||
type: object
|
||||
properties:
|
||||
mode:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/ChargeMode"
|
||||
$ref: "#/components/schemas/Mode"
|
||||
/vehicles/{name}/plan/repeating:
|
||||
post:
|
||||
operationId: updateVehicleRepeatingPlans
|
||||
|
|
@ -1184,7 +1183,7 @@ paths:
|
|||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/RepeatingPlan"
|
||||
$ref: "#/components/schemas/RepeatingPlan"
|
||||
responses:
|
||||
"200":
|
||||
description: Success
|
||||
|
|
@ -1193,7 +1192,7 @@ paths:
|
|||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/RepeatingPlan"
|
||||
$ref: "#/components/schemas/RepeatingPlan"
|
||||
/vehicles/{name}/plan/soc:
|
||||
delete:
|
||||
operationId: deleteVehicleSocPlan
|
||||
|
|
@ -1249,14 +1248,14 @@ paths:
|
|||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/PlanStrategy"
|
||||
$ref: "#/components/schemas/PlanStrategy"
|
||||
responses:
|
||||
200:
|
||||
"200":
|
||||
description: Success
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/PlanStrategy"
|
||||
$ref: "#/components/schemas/PlanStrategy"
|
||||
/db/backup:
|
||||
get:
|
||||
operationId: downloadBackup
|
||||
|
|
@ -1434,6 +1433,16 @@ paths:
|
|||
description: Invalid parameters or database offline
|
||||
components:
|
||||
schemas:
|
||||
BatteryMode:
|
||||
description: Battery mode
|
||||
type: string
|
||||
example: normal
|
||||
enum:
|
||||
- unknown
|
||||
- normal
|
||||
- hold
|
||||
- charge
|
||||
- holdcharge
|
||||
ChangePassword:
|
||||
type: object
|
||||
properties:
|
||||
|
|
@ -1571,6 +1580,14 @@ components:
|
|||
- INFO
|
||||
- DEBUG
|
||||
- TRACE
|
||||
Mode:
|
||||
description: "Charging mode."
|
||||
type: string
|
||||
enum:
|
||||
- "off"
|
||||
- "now"
|
||||
- "minpv"
|
||||
- "pv"
|
||||
Odometer:
|
||||
nullable: true
|
||||
type: "number"
|
||||
|
|
@ -1609,10 +1626,51 @@ components:
|
|||
type: integer
|
||||
example: 3600
|
||||
minimum: 0
|
||||
Rate:
|
||||
type: object
|
||||
description: A charging interval
|
||||
properties:
|
||||
start:
|
||||
description: Start
|
||||
$ref: "#/components/schemas/Timestamp"
|
||||
end:
|
||||
description: End
|
||||
$ref: "#/components/schemas/Timestamp"
|
||||
value:
|
||||
description: Cost
|
||||
type: number
|
||||
minimum: 0
|
||||
Rates:
|
||||
type: array
|
||||
items:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/Rate"
|
||||
$ref: "#/components/schemas/Rate"
|
||||
PlanStrategy:
|
||||
description: Charging plan strategy configuration
|
||||
type: object
|
||||
properties:
|
||||
continuous:
|
||||
description: "Force continuous planning"
|
||||
type: boolean
|
||||
precondition:
|
||||
description: "Precondition duration in seconds"
|
||||
type: integer
|
||||
minimum: 0
|
||||
RepeatingPlan:
|
||||
externalDocs:
|
||||
url: https://docs.evcc.io/en/features/plans#repeating-plans
|
||||
type: object
|
||||
properties:
|
||||
active:
|
||||
description: "Set plan active."
|
||||
type: boolean
|
||||
soc:
|
||||
$ref: "#/components/schemas/Soc"
|
||||
time:
|
||||
$ref: "#/components/schemas/HourMinuteTime"
|
||||
tz:
|
||||
$ref: "#/components/schemas/IANATimeZone"
|
||||
weekdays:
|
||||
$ref: "#/components/schemas/Weekdays"
|
||||
Soc:
|
||||
description: SOC in %
|
||||
type: number
|
||||
|
|
@ -1624,6 +1682,27 @@ components:
|
|||
type: number
|
||||
example: 50
|
||||
minimum: 0
|
||||
State:
|
||||
description: "The actual state structure is not documented yet. Most values should be self-explanatory. Note: While the overall structure is quite stable, details may change between releases."
|
||||
type: object
|
||||
StaticEnergyPlan:
|
||||
externalDocs:
|
||||
url: https://docs.evcc.io/en/features/plans#energy-amount-plan
|
||||
type: object
|
||||
properties:
|
||||
energy:
|
||||
$ref: "#/components/schemas/Energy"
|
||||
time:
|
||||
$ref: "#/components/schemas/Timestamp"
|
||||
StaticSocPlan:
|
||||
externalDocs:
|
||||
url: https://docs.evcc.io/en/features/plans#create-charging-plan
|
||||
type: object
|
||||
properties:
|
||||
soc:
|
||||
$ref: "#/components/schemas/Soc"
|
||||
time:
|
||||
$ref: "#/components/schemas/Timestamp"
|
||||
Timestamp:
|
||||
description: Timestamp in RFC3339 format
|
||||
type: string
|
||||
|
|
@ -1720,7 +1799,7 @@ components:
|
|||
in: path
|
||||
required: true
|
||||
schema:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/ChargeMode"
|
||||
$ref: "#/components/schemas/Mode"
|
||||
soc:
|
||||
name: soc
|
||||
description: SOC in %
|
||||
|
|
@ -1782,7 +1861,7 @@ components:
|
|||
in: path
|
||||
required: true
|
||||
schema:
|
||||
$ref: "./openapi.state.yaml#/components/schemas/BatteryMode"
|
||||
$ref: "#/components/schemas/BatteryMode"
|
||||
costLimit:
|
||||
name: cost
|
||||
description: Cost limit in configured currency (default EUR) or CO2 limit in g/kWh
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ import (
|
|||
|
||||
func TestOpenAPIValidation(t *testing.T) {
|
||||
loader := openapi3.NewLoader()
|
||||
loader.IsExternalRefsAllowed = true
|
||||
doc, err := loader.LoadFromFile("openapi.yaml")
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, doc.Validate(loader.Context))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue