Commit Graph
75 Commits
Author SHA1 Message Date
Teemu R a93b4e7197 Use device-native kelvins for tplink color temperature (#85646) 2023-02-21 12:52:50 -06:00
Teemu R 1d928f05fa Update python-kasa to 0.5.1 (#88416) 2023-02-18 22:39:08 -06:00
epenet 9a5f88f55f Add type hints to integration tests (part 23) (#88235) 2023-02-17 16:40:46 +01:00
Franck Nijhof ed79265843 Enable Ruff PT006 (#88165)
* Enable Ruff PT006

* Adjust existing cases

* Fix tests

* Remove unneeded parentheses
2023-02-15 14:09:50 +01:00
Teemu R 5335dfbc67 Prefer effect over other light settings for tplink (#85642) 2023-02-14 10:29:11 -06:00
epenet 278050a73f Add type hints to integration tests (t-z) (#87707) 2023-02-08 19:10:53 +01:00
epenet a79be493e5 Adjust hass_client type hint in integration tests (#86954)
* Adjust hass_client type hint in integration tests

* Adjust hass_client_no_auth

* Fix rebase
2023-02-02 16:29:57 -05:00
Franck Nijhof bba9ad3243 Revert "Adapt tplink to use has_entity_name" (#85595)
Revert "Adapt tplink to use has_entity_name (#85577)"

This reverts commit ca0fe488ba.
2023-01-10 10:06:58 +01:00
Teemu R ca0fe488ba Adapt tplink to use has_entity_name (#85577)
* Adapt tplink to use has_entity_name

* Set the name for individual smartstrip sockets

* Fix tests
2023-01-10 09:40:29 +01:00
Franck Nijhof a6244eea28 Search/replace RESULT_TYPE_* by FlowResultType enum (#74656) 2022-07-07 21:28:18 +02:00
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 KostonandMartin Hjelmare 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 RandJ. Nick Koston 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
epenetandepenet 560546f65e Use dataclass for DhcpServiceInfo (#60136)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-23 13:35:53 +01:00
epenetandepenet 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 RandPaulus Schoutsen 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 SchoutsenandMartin Hjelmare 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
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
MichaelandPaulus Schoutsen 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