8000 Add device fixture for P316M(US) by TheLinuxGuy · Pull Request #1568 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@TheLinuxGuy
Copy link
Contributor

As requested, fixture only PR from #1561

@TheLinuxGuy
Copy link
Contributor Author

@rytilahti are OK taking care of the follow up changes needed to fix the presubmits? https://github.com/python-kasa/python-kasa/actions/runs/17194547887

I feel that in my other PR you wanted me to simply follow the instructions (use your tools that dump the json and create the files in this PR and DO NOT modify anything else)... so the only way the checks here will pass is if you would propose the changes to fix things like:

=========================== short test summary info ============================
FAILED tests/smart/modules/test_powerprotection.py::test_features[power_protection_threshold-protection_threshold-int-P316M(US)_1.6_1.0.5.json-SMART] - KeyError: 'enabled'
FAILED tests/smart/modules/test_powerprotection.py::test_set_enable[P316M(US)_1.6_1.0.5.json-SMART] - KeyError: 'enabled'
FAILED tests/smart/modules/test_powerprotection.py::test_set_threshold[P316M(US)_1.6_1.0.5.json-SMART] - AssertionError: expected call not found.
Expected: call('set_protection_power', {'enabled': <ANY>, 'protection_power': 123})
  Actual: call('set_protection_power', {'protection_enabled': False, 'protection_power': 123})

pytest introspection follows:

Args:
assert ('set_protect..._power': 123}) == ('set_protect..._power': 123})
  
  At index 1 diff: {'protection_enabled': False, 'protection_power': 123} != {'enabled': <ANY>, 'protection_power': 123}
  
  Full diff:
    (
        'set_protection_power',
        {
  -         'enabled': <ANY>,
  +         'protection_enabled': False,
            'protection_power': 123,
        },
    )
FAILED tests/test_childdevice.py::test_childdevice_properties[P316M(US)_1.6_1.0.5.json-SMART] - ExceptionGroup: Accessing child properties caused exceptions (1 sub-exception)

@rytilahti rytilahti changed the title Update documentation and add new device fixture for P316M(US) Add device fixture for P316M(US) Aug 30, 2025
Copy link
Member
@rytilahti rytilahti left a comment

Choose a reason for hiding this comment

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

Ah, good catch! Sorry for the delay, I added some changes to fix the tests so we can move on to get this merged, hope that's fine by you.

@rytilahti rytilahti enabled auto-merge (squash) August 30, 2025 14:37
@codecov
Copy link
codecov bot commented Aug 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.70%. Comparing base (08e7ab5) to head (2affaad).
⚠️ Report is 10 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1568   +/-   ##
=======================================
  Coverage   92.70%   92.70%           
=======================================
  Files         156      156           
  Lines        9599     9602    +3     
  Branches      974      974           
=======================================
+ Hits         8899     8902    +3     
  Misses        499      499           
  Partials      201      201           

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@rytilahti rytilahti merged commit 2b881cf into python-kasa:master Aug 30, 2025
18 checks passed
rytilahti added a commit to rytilahti/python-kasa that referenced this pull request Oct 26, 2025
Adds device fixture and updates powerprotection module to accept the changed enabled key.
---------

Co-authored-by: komodo <komodo@komo.do>
Co-authored-by: Teemu Rytilahti <tpr@iki.fi>
rytilahti added a commit to rytilahti/python-kasa that referenced this pull request Nov 10, 2025
Adds device fixture and updates powerprotection module to accept the changed enabled key.
---------

Co-authored-by: komodo <komodo@komo.do>
Co-authored-by: Teemu Rytilahti <tpr@iki.fi>
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.

2 participants

0