8000 Make calling update on child devices consistent and give control over whether to update the parent by sdb9696 · Pull Request #1021 · python-kasa/python-kasa · GitHub
[go: up one dir, main page]

Skip to content

Make calling update on child devices consistent and give control over whether to update the parent #1021

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

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

sdb9696
Copy link
Collaborator
@sdb9696 sdb9696 commented Jun 28, 2024

This PR is normalising the behaviour of update across iot and smart devices such that:

  • update can be called by consumers on child devices without them being surprised that it is a noop or partial for some devices and not for others.
  • update_children (renamed update_children_or_parent) has the same default value of True across devices.
  • smart devices don't call update on children if update_children_or_parent is False.
  • Child devices can be updated with update_children_or_parent=False so they just update their own module queries.
  • Consumers who previously passed update_children as a kwarg retain the same behaviour and get a deprecation warning. (i.e. smart ignores the parameter and always updates children)

Currently Hubs do not support updates on children directly but this could be a good feature to implement in another PR to allow finer grained control for hubs with many attached devices.

Not to be merged until we're finished with 0.7.0.x patches

@sdb9696 sdb9696 closed this Jun 28, 2024
@sdb9696 sdb9696 reopened this Jun 28, 2024
@sdb9696 sdb9696 closed this Jun 28, 2024
@sdb9696 sdb9696 reopened this Jun 28, 2024
Copy link
codecov bot commented Jun 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.05%. Comparing base (7427a88) to head (2b6500f).
Report is 73 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1021      +/-   ##
==========================================
+ Coverage   92.03%   92.05%   +0.02%     
==========================================
  Files          84       84              
  Lines        5798     5828      +30     
  Branches     1400     1409       +9     
==========================================
+ Hits         5336     5365      +29     
- Misses        356      358       +2     
+ Partials      106      105       -1     

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

@sdb9696 sdb9696 marked this pull request as ready for review June 29, 2024 08:31
@sdb9696 sdb9696 requested a review from rytilahti June 29, 2024 08:38
@sdb9696 sdb9696 added this to the 0.7.1 milestone Jun 29, 2024
@sdb9696 sdb9696 added the maintenance Project improvements and maintenance label Jul 2, 2024
@sdb9696 sdb9696 removed this from the 0.7.1 milestone Aug 30, 2024
@sdb9696
Copy link
Collaborator Author
sdb9696 commented Sep 27, 2024

Marking as draft for now as need to think a bit more about the HA side of this.

@sdb9696 sdb9696 marked this pull request as draft September 27, 2024 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Project improvements and maintenance no-stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0