Adding a general management of json errors for some types
Breaking change
Proposed change
This change is a more robust fix for exceptions thrown when the expected data type does not match with the json that are received from HA. It supports the subset of data types used in the HassClient data model.
Type of change
- [ ] Dependency upgrade
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (which adds functionality to an existing integration)
- [ ] Breaking change (fix/feature causing existing functionality to break)
- [x] Code quality improvements to existing code or addition of tests
Additional information
- This PR fixes or closes issue: fixes #
- This PR is related to issue:
- Link to documentation pull request:
Checklist
- [x] The code change is tested and works locally.
- [x] Local tests pass. Your PR cannot be merged unless tests pass
- [x] The code compiles without warnings (code quality check)
- [x] Tests have been added to verify that the new code works.
If user exposed functionality or configuration are added/changed:
- [ ] Documentation added/updated for http://netdaemon.xtz
Codecov Report
Attention: Patch coverage is 70.49180% with 18 lines in your changes missing coverage. Please review.
Project coverage is 82%. Comparing base (
f0480a1) to head (cbd28fa). Report is 60 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #1127 +/- ##
====================================
- Coverage 82% 82% -1%
====================================
Files 190 191 +1
Lines 3779 3825 +46
Branches 425 426 +1
====================================
+ Hits 3113 3144 +31
- Misses 501 516 +15
Partials 165 165
| Flag | Coverage Δ | |
|---|---|---|
| unittests | 82% <70%> (-1%) |
:arrow_down: |
Flags with carried forward coverage won't be shown. Click here to find out more.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.