Commit graph

65 commits

Author SHA1 Message Date
J. Nick Koston
689b347904
Increase tplink effects random seed allowed range to 1-600 (#69725)
* Increase tplink effects random seed allowed range to 1-600

Reported https://community.home-assistant.io/t/tp-link-integration-support-for-kl430-led-light-strip/190635/62?u=bdraco

* cover
2022-04-09 10:08:17 +03:00
J. Nick Koston
6dc72ebf6c
Mark backgrounds optional for tplink random effects (#69622) 2022-04-07 23:19:17 +02:00
J. Nick Koston
8b2948f030
Ensure state is restored when turning on tplink lights without a color mode (#69308) 2022-04-05 13:46:12 -07:00
J. Nick Koston
fb41734342
Add support for custom effects to tplink light strips (#68502) 2022-03-30 09:34:09 -07:00
J. Nick Koston
49bc572d6d
Fix tplink effect not being restored when turning back on (#68533)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2022-03-23 10:01:20 +01:00
J. Nick Koston
94cd656670
Use new internal_state property in tplink diagnostics (#68497) 2022-03-22 14:58:16 +01:00
J. Nick Koston
06ebb0b8b3
Add support for effects to tplink light strips (#65166) 2022-03-21 20:20:40 -10:00
Teemu R
16cc2b790b
Create LED switches for tplink dimmers (#66839) 2022-02-21 19:02:11 +01:00
J. Nick Koston
38b9bea9a3
Switch tplink to use integration discovery (#66575) 2022-02-16 12:06:58 +01:00
Teemu R
fd7e2e76e7
Add tplink diagnostics (#65822) 2022-02-06 16:50:44 -06:00
Teemu R
f4ebb03bab
Add tplink hardware version to device info (#65951)
* Add tplink hardware version to device info

* Update mocks

Co-authored-by: J. Nick Koston <nick@koston.org>
2022-02-07 00:37:54 +02:00
Marc Mueller
ef7316d8d9
Update typing (5) [tests] (#63926) 2022-01-11 21:28:13 +01:00
J. Nick Koston
e0ef066022
Remove legacy migration and yaml from tplink (#62457)
- tplink has been fully migrated to a config flow in previous
  versions.
2021-12-21 11:24:32 +01:00
epenet
560546f65e
Use dataclass for DhcpServiceInfo (#60136)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-23 13:35:53 +01:00
epenet
eb70d328ca
Use DhcpServiceInfo in tplink (#60114)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-22 11:51:47 +01:00
Raphaël Beamonte
e42bb244b7
Add TP-Link LED control for Kasa plugs and strips (#59621) 2021-11-13 17:50:37 -06:00
J. Nick Koston
5b3711ed19
Use switch format unique ids for tplink dimmers (#57346) 2021-10-10 00:02:33 -07:00
J. Nick Koston
e77fae56d9
Migrate tplink hosts that were previously imported from yaml (#57308) 2021-10-08 08:58:18 -07:00
Teemu R
8fb0da7720
Stopgap fix for inconsistent upstream API of tplink dimmers (#57285) 2021-10-07 20:15:13 -07:00
Teemu R
36a22400e5
Fix transition handling for tplink lights (#57272)
* Fix transition handling for tplink light

* Apply suggestions from code review

* Test that all transitions are passed correctly

* Fix linting

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-10-08 00:20:26 +02:00
J. Nick Koston
ac3741df41
Fix RGB only (no color temp) devices with tplink (#57267) 2021-10-07 10:14:14 -10:00
J. Nick Koston
a2dcc0308b
Discover tplink devices periodically (#57221)
- These devices sometimes do not respond on the first try
  or may be subject to transient broadcast failures, or
  overloads. We now try discovery periodically once the
  integration has been loaded.

- We used to try this 4x at startup, but that solution
  seemed to aggressive as we want to be sure we pickup
  the devices after startup as well since the network
  will likely be more calm after startup.
2021-10-07 17:52:24 +02:00
Paulus Schoutsen
a4d9019ffc
Refactor persistent notification to no longer route all data via a service (#57157)
* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 12:58:00 +02:00
J. Nick Koston
77af741099
Prevent tplink from opening sockets in tests (#57058)
Supports #55516
2021-10-04 20:25:09 +02:00
J. Nick Koston
4c51d0d2cf
Round tplink energy sensors to prevent insignificant updates (#56999)
- These sensors wobble quite a bit and the precision did
  not have sensible limits which generated a massive amount
  of data in the database which was not very useful
2021-10-03 21:28:39 +02:00
J. Nick Koston
cf36d0966d
Add coverage to verify tplink unique ids (#56746) 2021-09-28 17:57:22 -07:00
J. Nick Koston
bc59387437
Explictly close the TPLink SmartDevice protocol on unload (#56743)
* Explictly close the TPLink SmartDevice protocol on unload

- There is a destructor that will eventually do this when
  the object gets gc. Its better to explictly do it at
  unload.

* fix coro mock
2021-09-28 18:36:45 +02:00
J. Nick Koston
c95f7a5ba6
Add network support to tplink for discovery across subnets (#56721) 2021-09-28 09:58:25 -05:00
Teemu R
b40d229369
Rework TPLink integration to use python-kasa (#56701)
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Teemu R. <tpr@iki.fi>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-27 14:11:55 -05:00
J. Nick Koston
e6e8d7eded
Convert color temperature to visible color in lights (#55219) 2021-08-25 21:56:36 +02:00
Michael
b2725918b1
Fix TP-Link smart strip devices (#53799) 2021-08-02 09:47:54 -07:00
Michael
da1a9bcbf0
Do not block setup of TP-Link when device unreachable (#53770) 2021-08-01 14:58:55 -07:00
Michael
692665e46c
Apply left suggestions #53596 for TP-Link (#53737) 2021-07-29 22:11:15 -07:00
Michael
bedb9550f5
Move TP-Link power and energy switch attributes to sensors (#53596)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-07-29 11:02:47 -07:00
Bram Kragten
b00ccf98f0
TP Link: Don't report HS when in CT mode (#49704)
* TP Link: Don't report HS when in CT mode

* Update tests
2021-04-27 11:19:21 +02:00
Mario Limonciello
9fd6980144
Avoid divide by zero errors in tplink light integration (#48235) 2021-03-31 17:16:24 +02:00
Marc Mueller
54d1e9985f
Update typing 15 (#48079) 2021-03-18 15:13:22 +01:00
Ville Skyttä
dc880118a4
Lint suppression cleanups (#47248)
* Unused pylint suppression cleanups

* Remove outdated pylint bug references

* Add flake8-noqa config and note to run it every now and then

* Add codes to noqa's

* Unused noqa cleanups
2021-03-02 09:02:04 +01:00
Franck Nijhof
65cf2fcb6f
Drop asynctest (#44746) 2021-01-01 22:31:56 +01:00
Angelo Gagliano
d42bdcfc2a
Move async_add_entities back to event loop for tplink component (#42454) 2020-10-28 09:51:53 +01:00
Angelo Gagliano
34283ac283
Add retry for unavailable static tplink devices after HA starts (#42247) 2020-10-27 10:02:16 +01:00
Paulus Schoutsen
5dac3883b0
Stub light profiles (#42232) 2020-10-23 16:28:21 +02:00
Angelo Gagliano
874e1f6103
Prevent tplink missing devices and unavailable state (#39762)
* Adds self to codeowners for tplink

* Adds retry to update to prevent missing devices

* Runs through isort and corrects async commit

* Runs through black

* Runs through pre-checks

* Corrects and matches var names

* Re-runs through black

* Corrects var name

* Removes the retry loop and in favor of async add

* Cleanup imports

* Removes no longer valid test

* Removes is_ready and only log retry once

* Corrects switch logging vars

* Adds list of entities to add_entities

* Consumes exception for attempt_update

* Consumes specific exception

* Removes unnecessary update

* Reducing back to 2 seconds

* Removes useless return

* Call get_sysinfo for all at once

* Formated black

* Adds missing docstirng

* Corrects docstring

* Update homeassistant/components/tplink/light.py

Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>

* Corrects sysinfo call

* Adds default for host vars

* Adds log when device responds again

* Revert host alias default

* Removes unncessary host var

* Removes host var

* Get device details from sysinfo

* Use host and alias for log msg

* Gets hosts from smartbulb

* Changes retry logging to debug

* Attempts coverage add

* Removes unused import

* Updates tests for new retry

* Runs through isort

* Removes unneeded try

* Prevents static entries from failing integration

* Format black

* Forces an update after turn on off

* Remove common test

* Revert update after turn_on off

* Adds patch for sleep_time 0

* Returns False when update fails

Co-authored-by: Anders Melchiorsen <amelchio@nogoto.net>
2020-10-11 21:10:36 +02:00
Franck Nijhof
1c2ebdf307
Upgrade black to 20.8b1 (#39287) 2020-08-27 13:56:20 +02:00
Bas Nijholt
0427d87ba4
Bump codespell from v1.16.0 to v1.17.1 and fix new spelling errors (#38663) 2020-08-08 14:41:02 +02:00
Paulus Schoutsen
2af984917e
Use asynctest-mock in most places (#35109)
* Use asynctest-mock in most places

* Fix broken patch in pilight
2020-05-03 11:27:19 -07:00
Paulus Schoutsen
76f392476b
Use a future for mock coro (#34989) 2020-04-30 16:31:00 -07:00
J. Nick Koston
5516063f46
Prevent tplink tests from doing I/O (#34879) 2020-04-29 13:44:40 -07:00
J. Nick Koston
f516b24dfb
Reduce tplink loss of precision during brightness conversion (#34210) 2020-04-14 20:48:35 +02:00
J. Nick Koston
a000af5c03
Fix tplink HS220 dimmers (round 2) (#33928)
* HS220 dimmers are handled as lights with a limited feature set

* Dimmers look up has has_emeter every call so this is cached as well now
to resovle the performance issue.
2020-04-09 17:10:02 -07:00