-
Notifications
You must be signed in to change notification settings - Fork 210
tplink: add support for kasa smart plugs #1693
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
base: master
Are you sure you want to change the base?
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 55.6% 55.6% -0.1%
========================================
Files 172 172
Lines 13462 13476 +14
========================================
+ Hits 7491 7493 +2
- Misses 5971 5983 +12
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
- 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>
ff6fd02
to
64eef0a
Compare
Description
tplink
resource definition to support smart plug devices like the HS103, in addition to the existing IotStrip functionality.index
argument forNetworkPowerPort
optional and default to0
if not provided.index
is now optional.Tested locally using both a KP303 strip (already supported) and an HS103. Here's the latter's
kasa discover
data:And here is the sample exporter config:
Checklist