Skip to content

Conversation

@bouwew
Copy link
Contributor

@bouwew bouwew commented Aug 19, 2023

All changes:

  • Integrate the process of creating binary_sensors, sensors, and switches dicts.
  • Fix an apparent notification-bug for p1v4
  • Improve typing: fix all type-ignores

@codecov
Copy link

codecov bot commented Aug 19, 2023

Codecov Report

Merging #375 (1fceb16) into main (59ffe4c) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #375   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines         2697      2685   -12     
=========================================
- Hits          2697      2685   -12     
Files Changed Coverage Δ
tests/test_smile.py 100.00% <ø> (ø)
plugwise/__init__.py 100.00% <100.00%> (ø)
plugwise/constants.py 100.00% <100.00%> (ø)
plugwise/helper.py 100.00% <100.00%> (ø)
plugwise/util.py 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@CoMPaTech
Copy link
Member

Please set labels :)

@bouwew bouwew marked this pull request as ready for review August 25, 2023 17:49
@bouwew bouwew requested a review from a team as a code owner August 25, 2023 17:54
@bouwew bouwew changed the title Integrate creating platform-dicts Integrate creating platform-dicts and improve typing Aug 26, 2023
@CoMPaTech
Copy link
Member

Although this PR is large enough we probably should ensure to promote it to > py3.9, which would require some changes to

  • pyproject.toml' (1x py39, and 2x 3.9`)
  • scripts/python-venv.sh
  • mention in CHANGELOG

if not device["binary_sensors"]:
device.pop("binary_sensors")
if not device["sensors"]:
device.pop("sensors")
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function added.

# 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":
Copy link
Member

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)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented.

@bouwew bouwew added bug Something isn't working quality labels Aug 29, 2023
@CoMPaTech
Copy link
Member

👍

@bouwew bouwew merged commit 0412862 into main Aug 29, 2023
@bouwew bouwew deleted the reorder branch August 29, 2023 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working quality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants