-
Notifications
You must be signed in to change notification settings - Fork 8
Integrate creating platform-dicts and improve typing #375
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
Conversation
Codecov Report
@@ Coverage Diff @@
## main #375 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 6 6
Lines 2697 2685 -12
=========================================
- Hits 2697 2685 -12
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
Please set labels :) |
After split in DEVICE_MEASUREMENTS and HEATER_CENTRAL_MEASUREMENTS
|
Although this PR is large enough we probably should ensure to promote it to > py3.9, which would require some changes to
|
plugwise/__init__.py
Outdated
| if not device["binary_sensors"]: | ||
| device.pop("binary_sensors") | ||
| if not device["sensors"]: | ||
| device.pop("sensors") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We sort of have this twice, should we create a helper function to 'create' within an object instead of deleting afterwards?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Function added.
plugwise/helper.py
Outdated
| # measurements with states "on" or "off" that need to be passed directly | ||
| if measurement not in ("select_dhw_mode"): | ||
| data[measurement] = format_measure( # type: ignore [literal-required] | ||
| if meas_rn == "select_dhw_mode": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With py 3.10 now lets use match case (i.e. switch)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implemented.
|
👍 |
All changes: