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

Convert dataclasses to pydantic models #245

Draft
wants to merge 8 commits into
base: projects/zha-web-socket-server
Choose a base branch
from

Conversation

dmulcahey
Copy link
Contributor

First step towards adding web socket functionality. This PR converts the dataclass objects to Pydantic models so they can be validated, serialized and deserialized between the WS server and clients.

Note: the target branch is a project branch and NOT dev.

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.32%. Comparing base (3d34a30) to head (477940e).

Additional details and impacted files
@@                       Coverage Diff                       @@
##           projects/zha-web-socket-server     #245   +/-   ##
===============================================================
  Coverage                           96.31%   96.32%           
===============================================================
  Files                                  61       62    +1     
  Lines                                9366     9383   +17     
===============================================================
+ Hits                                 9021     9038   +17     
  Misses                                345      345           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@puddly
Copy link
Contributor

puddly commented Oct 17, 2024

As long as unit tests pass, I think this may actually be something that can be merged straight into dev. Or do you wanna keep it separate?

@dmulcahey
Copy link
Contributor Author

As long as unit tests pass, I think this may actually be something that can be merged straight into dev. Or do you wanna keep it separate?

separate. This is actually auto validating the objects on creation and I want to make sure everything is good before putting it in dev.

@dmulcahey dmulcahey marked this pull request as draft October 17, 2024 21:45
@dmulcahey dmulcahey marked this pull request as ready for review October 18, 2024 15:19
@dmulcahey dmulcahey requested a review from puddly October 18, 2024 15:21
@dmulcahey dmulcahey marked this pull request as draft October 19, 2024 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants