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

Enhancement based on #425 #347

Merged
merged 11 commits into from
Jul 9, 2023
Merged

Enhancement based on #425 #347

merged 11 commits into from
Jul 9, 2023

Conversation

bouwew
Copy link
Contributor

@bouwew bouwew commented Jul 5, 2023

Final scope: no fix needed for plugwise/plugwise-beta#425, a user-error causes the error shown in the HA LOG.

Changes:

  • Based on the user-error, add raising an error when the user provides incorrect input-data.
  • Add a related test-case
  • Improve test-output for selected test
  • Improve raised string formatting.

@bouwew bouwew requested a review from CoMPaTech July 5, 2023 15:49
@codecov
Copy link

codecov bot commented Jul 5, 2023

Codecov Report

Merging #347 (7df1480) into main (8c63dee) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #347   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            6         6           
  Lines         2640      2646    +6     
=========================================
+ Hits          2640      2646    +6     
Impacted Files Coverage Δ
plugwise/__init__.py 100.00% <100.00%> (ø)
tests/test_smile.py 100.00% <100.00%> (ø)

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

@CoMPaTech CoMPaTech added the bug Something isn't working label Jul 5, 2023
@bouwew bouwew force-pushed the fix-#425 branch 3 times, most recently from 11e5be3 to f530023 Compare July 6, 2023 15:12
@bouwew bouwew added enhancement New feature or request and removed bug Something isn't working labels Jul 6, 2023
@bouwew bouwew marked this pull request as ready for review July 6, 2023 15:55
@bouwew bouwew requested a review from CoMPaTech July 6, 2023 15:55
@bouwew bouwew changed the title Fix for #425 Enhancement based on #425 Jul 6, 2023
@@ -685,6 +685,11 @@ async def set_temperature(self, loc_id: str, items: dict[str, float]) -> None:
if "setpoint_high" in items:
tmp_setpoint_high = items["setpoint_high"]
tmp_setpoint_low = items["setpoint_low"]
else:
Copy link
Member

Choose a reason for hiding this comment

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

Suggest to rewrite as to raise if not "setpoint_high" in items:

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.

@@ -486,11 +486,11 @@ async def tinker_switch(
return tinker_switch_passed

@pytest.mark.asyncio
async def tinker_thermostat_temp(self, smile, loc_id, unhappy=False):
async def tinker_thermostat_temp(self, smile, loc_id, special=True, unhappy=False):
Copy link
Member

Choose a reason for hiding this comment

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

Suggest to rename to cooling_special or something likewise (as it is now non-descriptive how/why - or just add why special is there in the description line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed to block_cooling and revert the default value to False.

@bouwew bouwew merged commit 10646ef into main Jul 9, 2023
18 checks passed
@bouwew bouwew deleted the fix-#425 branch July 9, 2023 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants