Skip to content

Commit a60cd29

Browse files
committed
allow null VPD
1 parent ab43ae5 commit a60cd29

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

opensensor/collection_apis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ async def record_environment(
457457
):
458458
db = get_open_sensor_db()
459459

460-
# TODO - Refactor this after migration to FreeTier complete
460+
# Paid customers may have their own collection
461461
if user:
462462
collection_name = user.collection_name
463463
else:

opensensor/collections.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import json
22
from datetime import datetime
33
from decimal import Decimal
4-
from typing import List
4+
from typing import List, Optional
55

6-
from pydantic import BaseModel, validator
6+
from pydantic import BaseModel, Field, validator
77

88

99
class TimestampModel(BaseModel):
@@ -74,5 +74,5 @@ class VPD(BaseModel):
7474
"""
7575

7676
timestamp: datetime
77-
vpd: float
77+
vpd: Optional[float] = Field(None, description="The computed VPD value.")
7878
unit: str

0 commit comments

Comments
 (0)