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

Clean up events and properties #20

Merged
merged 3 commits into from
Mar 30, 2024
Merged

Clean up events and properties #20

merged 3 commits into from
Mar 30, 2024

Conversation

dmulcahey
Copy link
Contributor

@dmulcahey dmulcahey commented Mar 30, 2024

This PR:

  • converts remaining events to dataclasses
  • converts to_json -> info_object and makes it a property
  • converts get_state -> state and makes it a property
  • leverages cached_property where it makes sense to / is safe to. There are probably more that can be converted
  • rearranged code so properties come before methods for consistency (init, init_from_quirks are left before props)

fixes #7 by disabling the error globally for tests as there are a ton of false positives

Copy link

codecov bot commented Mar 30, 2024

Codecov Report

Attention: Patch coverage is 99.18033% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 93.50%. Comparing base (b5f068a) to head (e4f8f3d).

Files Patch % Lines
zha/application/platforms/light/__init__.py 94.33% 3 Missing ⚠️
zha/application/platforms/cover/__init__.py 93.54% 2 Missing ⚠️
zha/application/platforms/sensor/__init__.py 98.48% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #20      +/-   ##
==========================================
+ Coverage   93.28%   93.50%   +0.22%     
==========================================
  Files          61       61              
  Lines        9082     9330     +248     
==========================================
+ Hits         8472     8724     +252     
+ Misses        610      606       -4     

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

@dmulcahey dmulcahey merged commit db12f68 into dev Mar 30, 2024
6 checks passed
@dmulcahey dmulcahey deleted the dm/event-dataclasses branch March 31, 2024 01:19
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.

Correct MyPy unreachable code errors and remove associated type ignores
1 participant