tplink: add support for kasa smart plugs#1693
tplink: add support for kasa smart plugs#1693threexc wants to merge 4 commits intolabgrid-project:masterfrom
Conversation
e17fbb1 to
4edf37e
Compare
|
Pushed an update because I realized that the doc update didn't clarify that |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1693 +/- ##
========================================
- Coverage 45.2% 45.2% -0.1%
========================================
Files 174 174
Lines 13747 13763 +16
========================================
+ Hits 6221 6223 +2
- Misses 7526 7540 +14
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
Added a new test case in |
5c21895 to
a48b9a0
Compare
a48b9a0 to
d945598
Compare
15d1f49 to
e78a072
Compare
sjg20
left a comment
There was a problem hiding this comment.
I'm not sure what can be done about testing, but otherwise this LGTM
25fd909 to
ff6fd02
Compare
|
A few rebases recently, no changes to the logic. |
ff6fd02 to
64eef0a
Compare
64eef0a to
7704779
Compare
|
@Bastian-Krause @jluebbe anything holding this one back? |
7704779 to
ea77529
Compare
ea77529 to
7e04d60
Compare
|
Just rebasing again, no new additions. |
7e04d60 to
c976530
Compare
|
Rebased again. |
c976530 to
f4f2fc1
Compare
55e89a1 to
fe83e95
Compare
fe83e95 to
49eaf13
Compare
|
Rebased again. |
49eaf13 to
19847ed
Compare
19847ed to
40368ba
Compare
|
Just another rebase to keep the branch current. |
40368ba to
825c657
Compare
41e7ec8 to
2a80e27
Compare
|
Last force push was just a rebase on master. |
|
I took a look and it looked reasonable. Can you rebase and test again? |
7cdd89b to
a9f5d3f
Compare
Sorry for the wait. Fixed it up and did another test with my HS103 smart plug just now. I had to fix the default for the |
a9f5d3f to
0731483
Compare
0731483 to
1176293
Compare
1176293 to
db84f81
Compare
- differentiate between 'strip' and 'plug' devices, using simpler logic for controlling power on the latter - create new _power_get() async function to match _power_set() Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
Smart plugs and similar single-port network-controlled devices shouldn't require the exporter config to include the 'index' argument. Make it optional by including a default of 0 in NetworkPowerPort. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
- Document that 'index' is now optional - Change 'tplink' section to indicate it controls both smart plugs and power strips Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
This is similar test_create, but it doesn't pass an index value, testing that the default index of the NetworkPowerPort object is '0' and also that the NetworkPowerDriver can still be instantiated correctly. Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
db84f81 to
fcae346
Compare
Description
tplinkresource definition to support smart plug devices like the HS103, in addition to the existing IotStrip functionality.indexargument forNetworkPowerPortoptional and default to0if not provided.indexis now optional.Tested locally using both a KP303 strip (already supported) and an HS103. Here's the latter's
kasa discoverdata:And here is the sample exporter config:
Checklist