This commit is contained in:
parent
be039e7376
commit
00dff24767
8 changed files with 1208 additions and 843 deletions
|
@ -6,7 +6,7 @@ from fastapi import APIRouter, HTTPException, Security
|
|||
from fastapi.params import Depends
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from ocpp.v201.call import ResetPayload, SetVariablesPayload
|
||||
from ocpp.v201.call import Reset, SetVariables
|
||||
|
||||
from app.database import get_db
|
||||
from app.ocpp_proto import chargepoint_manager
|
||||
|
@ -146,7 +146,7 @@ async def reset_chargepoint(
|
|||
try:
|
||||
response = await chargepoint_manager.call(
|
||||
chargepoint_id,
|
||||
payload=ResetPayload(type=reset_request.type, evse_id=reset_request.evse_id)
|
||||
payload=Reset(type=reset_request.type, evse_id=reset_request.evse_id)
|
||||
)
|
||||
return ChargePointResetResponse(status=response.status)
|
||||
except TimeoutError:
|
||||
|
@ -269,7 +269,7 @@ async def update_chargepoint_variable(
|
|||
evse['connectorId'] = variable.connector_id
|
||||
result = await chargepoint_manager.call(
|
||||
chargepoint_id,
|
||||
payload=SetVariablesPayload(set_variable_data=[
|
||||
payload=SetVariables(set_variable_data=[
|
||||
{
|
||||
'attributeType': variable.type.value,
|
||||
'attributeValue': variable_update.value,
|
||||
|
|
|
@ -2,7 +2,7 @@ from fastapi import APIRouter, Depends, HTTPException
|
|||
from fastapi.params import Security
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
from ocpp.v201.call import RequestStopTransactionPayload
|
||||
from ocpp.v201.call import RequestStopTransaction
|
||||
|
||||
from app.ocpp_proto import chargepoint_manager
|
||||
from app.security import get_api_key
|
||||
|
@ -55,7 +55,7 @@ async def remote_stop_transaction(
|
|||
try:
|
||||
result = await chargepoint_manager.call(
|
||||
transaction.chargepoint_id,
|
||||
payload=RequestStopTransactionPayload(
|
||||
payload=RequestStopTransaction(
|
||||
transaction_id=transaction.id
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue