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

Add Fan interface for SMART devices #873

Merged
merged 13 commits into from
Apr 30, 2024
Merged

Add Fan interface for SMART devices #873

merged 13 commits into from
Apr 30, 2024

Conversation

sdb9696
Copy link
Collaborator

@sdb9696 sdb9696 commented Apr 26, 2024

Enables the Fan interface for devices supporting that component. Currently the only device with a fan is the ks240 which implements it as a child device. This PR adds a method get_module to search the child device for modules if it is a WallSwitch device type.

@rytilahti rytilahti added the enhancement New feature or request label Apr 27, 2024
Copy link

codecov bot commented Apr 29, 2024

Codecov Report

Attention: Patch coverage is 88.09524% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 89.23%. Comparing base (7db989e) to head (eceb954).

Files Patch % Lines
kasa/smart/smartdevice.py 80.76% 2 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #873      +/-   ##
==========================================
- Coverage   89.27%   89.23%   -0.04%     
==========================================
  Files          67       68       +1     
  Lines        4819     4851      +32     
  Branches     1186     1201      +15     
==========================================
+ Hits         4302     4329      +27     
- Misses        427      429       +2     
- Partials       90       93       +3     

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

kasa/smart/smartdevice.py Outdated Show resolved Hide resolved
kasa/smart/smartdevice.py Outdated Show resolved Hide resolved
kasa/smart/smartdevice.py Outdated Show resolved Hide resolved
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.

A couple of more nits, but I think this is otherwise ready-to-go 👍

kasa/tests/smart/modules/test_fan.py Outdated Show resolved Hide resolved
kasa/smart/smartdevice.py Show resolved Hide resolved
kasa/smart/modules/fanmodule.py Outdated Show resolved Hide resolved
@rytilahti
Copy link
Member

Feel free to add a description and merge this 👍

@sdb9696 sdb9696 changed the title Add Fan interface for devices Add Fan interface for SMART devices Apr 30, 2024
@sdb9696 sdb9696 merged commit 16f17a7 into master Apr 30, 2024
25 of 27 checks passed
@sdb9696 sdb9696 deleted the feat/fan_interface branch April 30, 2024 16:42
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.

None yet

2 participants