Archived
feat: add energy, weather and consumption endpoints with models and error handling
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
from pydantic import BaseModel, Field
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
class Spot(BaseModel):
|
||||
price: float = Field(..., description="Price in cents per kWh")
|
||||
start_date: datetime = Field(..., description="Start date")
|
||||
end_date: datetime = Field(..., description="End date")
|
||||
|
||||
|
||||
class Consumption(BaseModel):
|
||||
timestamp: datetime = Field(..., description="Timestamp")
|
||||
consumption: float = Field(..., description="Consumption in kWh")
|
||||
total_cost: float = Field(..., description="Total cost in euros")
|
||||
vat_percentage: float = Field(..., description="VAT percentage")
|
||||
Reference in New Issue
Block a user