2024-04-13 22:43:03 +02:00
|
|
|
from datetime import datetime
|
|
|
|
from typing import Optional
|
|
|
|
from uuid import UUID
|
|
|
|
from pydantic import BaseModel
|
|
|
|
|
|
|
|
from app.schemas.connector import Connector
|
|
|
|
|
2024-04-14 22:56:51 +02:00
|
|
|
from ocpp.v201.enums import ResetType, ResetStatusType
|
|
|
|
|
2024-04-13 22:43:03 +02:00
|
|
|
class ChargePointBase(BaseModel):
|
|
|
|
friendly_name: str
|
|
|
|
is_active: bool
|
|
|
|
|
|
|
|
class ChargePointUpdate(BaseModel):
|
|
|
|
friendly_name: Optional[str] = None
|
|
|
|
is_active: Optional[bool] = None
|
|
|
|
|
|
|
|
class ChargePointCreate(ChargePointBase):
|
|
|
|
pass
|
|
|
|
|
|
|
|
class ChargePoint(ChargePointBase):
|
|
|
|
id: UUID
|
|
|
|
last_seen: datetime | None
|
2024-04-14 17:55:26 +02:00
|
|
|
vendor_name: str | None
|
|
|
|
model: str | None
|
|
|
|
serial_number: str | None
|
|
|
|
firmware_version: str | None
|
2024-04-13 22:43:03 +02:00
|
|
|
connectors: list[Connector] = []
|
|
|
|
|
|
|
|
class Config:
|
|
|
|
from_attributes = True
|
|
|
|
|
|
|
|
class ChargePointPassword(BaseModel):
|
|
|
|
password: str
|
|
|
|
|
|
|
|
class ChargePointConnectionInfo(BaseModel):
|
|
|
|
connected: bool
|
2024-04-14 22:56:51 +02:00
|
|
|
|
|
|
|
class ChargePointResetRequest(BaseModel):
|
|
|
|
type: ResetType
|
|
|
|
evse_id: Optional[int] = None
|
|
|
|
|
|
|
|
class ChargePointResetResponse(BaseModel):
|
|
|
|
status: ResetStatusType
|