labgrid icon indicating copy to clipboard operation
labgrid copied to clipboard

driver/power/tplink: use IotStrip instead of deprecated SmartStrip

Open Bastian-Krause opened this issue 1 year ago • 3 comments

Description This is a draft because python-kase 0.7.0 requires Python >=3.9, labgrid still supports Python 3.8.

Increase the minimum python-kasa version to 0.7.0. This allows us to use a newly introduced and not deprecated replacement for the kasa.SmartStrip class.

Since python-kasa 0.7.0, the SmartStrip class is deprecated.

The docs state:

"If you want to continue to use the old API for older devices, you can use the classes in the iot module to avoid deprecation warnings."

https://python-kasa.readthedocs.io/en/stable/deprecated.html#deprecated-api-reference

Do that.

Checklist

  • [ ] PR has been tested (untested, I don't have the required hardware)

Bastian-Krause avatar Jun 27 '24 10:06 Bastian-Krause

@CardboardTurkey You contributed the original code. Could you take a look at this?

Bastian-Krause avatar Jun 27 '24 11:06 Bastian-Krause

This looks reasonable! I'm afraid I no longer have access to the hardware required to test these changes though.

CardboardTurkey avatar Jun 27 '24 11:06 CardboardTurkey

Rebased on latest master. I think we should merge this "as is".

Bastian-Krause avatar Oct 14 '24 09:10 Bastian-Krause

Just my 3 cents in this - seems that yet another rebase is needed. In the meantime the structure of pyproject.toml has changed and support for Python >= 3.8 was dropped. Last kasa version to support Python >= 3.9 was 0.7.7. I guess the minimum python-kasa version can be increased as well.

MarekSzczypinski avatar Feb 21 '25 22:02 MarekSzczypinski

@MarekSzczypinski Thanks for pinging me. I'd like to keep the dependencies as lose as possible, so let's stick with 0.7.0 as a lower boundary.

Bastian-Krause avatar Feb 24 '25 16:02 Bastian-Krause

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 55.8%. Comparing base (9741924) to head (e46c76c). Report is 30 commits behind head on master.

:white_check_mark: All tests successful. No failed tests found.

Files with missing lines Patch % Lines
labgrid/driver/power/tplink.py 33.3% 2 Missing :warning:
Additional details and impacted files
@@          Coverage Diff           @@
##           master   #1431   +/-   ##
======================================
  Coverage    55.8%   55.8%           
======================================
  Files         170     170           
  Lines       13383   13383           
======================================
  Hits         7470    7470           
  Misses       5913    5913           
Flag Coverage Δ
3.10 56.1% <33.3%> (ø)
3.11 56.1% <33.3%> (ø)
3.12 56.1% <33.3%> (ø)
3.13 56.0% <33.3%> (ø)
3.9 56.1% <33.3%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Feb 24 '25 16:02 codecov[bot]