Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix Optional field #69

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions nonebot_plugin_heweather/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class Config:
extra = "allow"

fxDate: str
week: Optional[str]
date: Optional[str]
week: Optional[str] = None
date: Optional[str] = None
tempMax: str
tempMin: str
textDay: str
Expand Down Expand Up @@ -83,7 +83,7 @@ class Config:
co: str
no2: str
so2: str
tag_color: Optional[str]
tag_color: Optional[str] = None


class AirApi(BaseModel):
Expand All @@ -95,7 +95,7 @@ class Config:
extra = "allow"

code: str
now: Optional[Air]
now: Optional[Air] = None


class Warning(BaseModel):
Expand All @@ -121,7 +121,7 @@ class Config:
extra = "allow"

code: str
warning: Optional[List[Warning]]
warning: Optional[List[Warning]] = None


class Hourly(BaseModel):
Expand All @@ -133,11 +133,11 @@ class Config:
extra = "allow"

fxTime: str
hour: Optional[str]
hour: Optional[str] = None
temp: str
icon: str
text: str
temp_percent: Optional[str]
temp_percent: Optional[str] = None


class HourlyApi(BaseModel):
Expand Down
Loading