Skip to content

Commit

Permalink
Optional user fields (#38)
Browse files Browse the repository at this point in the history
* Fix optional fiels in User model

Fixes skodaconnect/homeassistant-myskoda#29

* Bump to 0.6.1
  • Loading branch information
dvx76 authored Sep 25, 2024
1 parent b5ba893 commit 321915d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
8 changes: 5 additions & 3 deletions myskoda/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,15 @@ class UserCapability(DataClassORJSONMixin):
class User(DataClassORJSONMixin):
capabilities: list[UserCapability]
country: str
date_of_birth: date = field(metadata=field_options(alias="dateOfBirth"))
email: str
first_name: str = field(metadata=field_options(alias="firstName"))
id: str
last_name: str = field(metadata=field_options(alias="lastName"))
nickname: str
phone: str
preferred_contact_channel: str = field(metadata=field_options(alias="preferredContactChannel"))
preferred_language: str = field(metadata=field_options(alias="preferredLanguage"))
profile_picture_url: str = field(metadata=field_options(alias="profilePictureUrl"))
date_of_birth: date | None = field(default=None, metadata=field_options(alias="dateOfBirth"))
preferred_contact_channel: str | None = field(
default=None, metadata=field_options(alias="preferredContactChannel")
)
phone: str | None = None
20 changes: 10 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "myskoda"
version = "0.6.0"
version = "0.6.1"
description = "Library for interaction with the MySkoda APIs."
authors = ["Frederick Gnodtke <[email protected]>"]
readme = "README.md"
Expand Down Expand Up @@ -46,18 +46,18 @@ target-version = "py312"
[tool.ruff.lint]
ignore = [
"COM812", # missing-trailing-comma
"D101", # undocumented-public-class
"D103", # undocumented-public-function
"D203", # one-blank-line-before-class
"D211", # blank-line-before-class
"D213", # multi-line-summary-second-line
"D101", # undocumented-public-class
"D103", # undocumented-public-function
"D203", # one-blank-line-before-class
"D211", # blank-line-before-class
"D213", # multi-line-summary-second-line
"FBT001", # boolean-type-hint-positional-argument
"FIX002", # line-contains-todo
"G004", # logging-f-string
"G004", # logging-f-string
"ISC001", # single-line-implicit-string-concatenation
"S101", # assert (used in tests)
"T201", # print
"TD003", # missing-todo-link
"S101", # assert (used in tests)
"T201", # print
"TD003", # missing-todo-link

]
select = ["ALL"]

0 comments on commit 321915d

Please sign in to comment.