Skip to content

Conversation

@rytilahti
Copy link
Member

@rytilahti rytilahti commented May 21, 2020

The commit messages should be self-explanatory. This is based on #59, so that has to be merged before this one. If wanted, I can split this into separate PRs..

The main goal behind the changes were to follow the DRY principle (removing unnecessary rtype, return etc. documentation where we already have type hints), splitting the unittests to class-specific files (for maintainability, to allow better "run only failed tests" from IDEs, and to make it less scary), and removing some useless public methods (set_icon, get_icon, set_time are not implemented and/or not useful for anyone using the api).

This will also move plugs from smartstrip to the smartdevice class under the name children. This way iterating over it using smartdevice reference does not require separate type casting.

3e19c56 strip: rename plugs property to children and move it to smartdevice
62fe83a improve bulb tests, simplify conftest
12a2f3c bulb: raise exception on color_temp error cases instead of returning zero values
8e673c7 pyproject: include cli tool to coverage, add config for interrogate (docstring coverage)
d8e3be5 remove adjust flake8 ignores (we have no setup.py anymore)
f05defd cli: indent device output to make it more easily readable when having multiple devices
5b7c257 Revise docstrings, remove superfluous information and remove unused methods ({set,get_icon} and set_time)
e7e858d protocol: remove the port parameter from query, as there are no other known ports, fix docstrings
a2454e5 Move tests to device-type specific test files to make improvements more approachable

@codecov-commenter
Copy link

codecov-commenter commented May 21, 2020

Codecov Report

Merging #63 into master will decrease coverage by 13.94%.
The diff coverage is 65.90%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #63       +/-   ##
===========================================
- Coverage   76.27%   62.32%   -13.95%     
===========================================
  Files           7        8        +1     
  Lines         826     1136      +310     
  Branches      110      165       +55     
===========================================
+ Hits          630      708       +78     
- Misses        172      393      +221     
- Partials       24       35       +11     
Impacted Files Coverage Δ
kasa/discover.py 41.50% <ø> (+0.38%) ⬆️
kasa/smartbulb.py 74.21% <0.00%> (-18.75%) ⬇️
kasa/smartplug.py 96.66% <ø> (-3.34%) ⬇️
kasa/smartdevice.py 64.02% <36.36%> (-15.86%) ⬇️
kasa/smartstrip.py 77.44% <55.55%> (-2.56%) ⬇️
kasa/protocol.py 55.93% <66.66%> (ø)
kasa/cli.py 52.83% <94.44%> (ø)
kasa/smartdimmer.py 76.47% <100.00%> (-11.77%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 836f170...3e19c56. Read the comment docs.

Copy link
Contributor

@kirichkov kirichkov left a comment

Choose a reason for hiding this comment

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

Looks good to me

@rytilahti rytilahti merged commit 644a10a into python-kasa:master May 27, 2020
@rytilahti rytilahti deleted the janitoring branch May 27, 2020 14:55
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.

3 participants