Skip to content

Commit

Permalink
Order the optional props
Browse files Browse the repository at this point in the history
  • Loading branch information
suda committed Apr 17, 2024
1 parent faeb8d3 commit f683ae8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions longship/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,24 +60,30 @@ class ConnectivityStatusChangedData:


@attr.s(auto_attribs=True)
class SessionStartData:
class BaseSessionData:
chargepointid: str
connectornumber: int
transactionid: str

@attr.s(auto_attribs=True)
class SessionStartData(BaseSessionData):
locationid: Optional[str] = attr.ib(default=None)
evseid: Optional[str] = attr.ib(default=None)


@attr.s(auto_attribs=True)
class SessionUpdateData(SessionStartData):
class SessionUpdateData(BaseSessionData):
totalenergyinkwh: float
totalduration: str
totalcosts: float
locationid: Optional[str] = attr.ib(default=None)
evseid: Optional[str] = attr.ib(default=None)


@attr.s(auto_attribs=True)
class SessionStopData(SessionUpdateData):
pass
locationid: Optional[str] = attr.ib(default=None)
evseid: Optional[str] = attr.ib(default=None)


@attr.s(auto_attribs=True)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "longship"
version = "2024.04.17"
version = "2024.04.18"
description = "A client library for accessing Longship API"

authors = ["Wojtek Siudzinski <admin@suda.pl>"]
Expand Down

0 comments on commit f683ae8

Please sign in to comment.