Commit Graph
57 Commits
Author SHA1 Message Date
epenet 485a78e0cf Improve light type hints in integrations (#90035)
* Improve light type hints in integrations

* Improve
2023-03-21 11:40:33 +01:00
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
Teemu R 5335dfbc67 Prefer effect over other light settings for tplink (#85642) 2023-02-14 10:29:11 -06:00
Ty Parker a703aa1dff Add repeat options to tplink sequence effect service (#86040)
Add repeat options to sequence effect service
2023-02-05 00:14:25 +01:00
epenet 7f1e1ed1d8 Enforce LightEntityFeature (#82460) 2022-11-22 07:14:47 +01:00
Marc Mueller a88e865dff Fix round typing [tplink] (#82437) 2022-11-21 18:59:08 +01:00
epenet dd7bc7971f Adjust type hints for LightEntityFeature (#82251) 2022-11-17 12:46:42 +01:00
epenet d58430bc93 Use light enums in tplink (#70787) 2022-04-26 14:54:17 +02:00
epenet 121d2008c2 Use ColorMode enum in tplink (#70542) 2022-04-23 09:46:54 -10: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 06ebb0b8b3 Add support for effects to tplink light strips (#65166) 2022-03-21 20:20:40 -10:00
J. Nick Koston 16655c4ccc Fix tplink color temp conversion (#68484) 2022-03-21 12:41:15 -10:00
Marc Mueller add741d789 Update coordinator typing (6) [t-v] (#68466) 2022-03-21 14:20:35 +01:00
Teemu RandJ. Nick Koston c985ebb3a7 Bump python-kasa to 0.4.1 for tplink integration (#64123)
Co-authored-by: J. Nick Koston <nick@koston.org>
2022-01-30 20:09:07 -06:00
J. Nick Koston 5b3711ed19 Use switch format unique ids for tplink dimmers (#57346) 2021-10-10 00:02:33 -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
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
Marc Mueller 7461af68b9 Use NamedTuple for color temperature range (#55626) 2021-09-03 17:41:32 +02:00
Teemu R 6afa4d6914 Skip updating tplink bulb state if the new state not reported by the device (#52310) 2021-06-29 19:14:34 +02:00
Franck NijhofandMartin Hjelmare 560dd0a0cc Typing improvements for TPLink (#50947)
* Typing improvements for TPLink

* Update homeassistant/components/tplink/common.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-22 13:47:26 +01:00
gabrialdestruir f814a7a8ae Add tplink light setting ignore default (#50334)
This fixes issue #50115 by allowing color, brightness, and temperature to be set from an off state. This adds code to allow "ignore_default=1" to be sent to bulb letting it know to power on with the parameters set.
2021-05-09 16:27:49 +02: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
jan iversen 6992e24263 Rename HomeAssistantType —> HomeAssistant, integrations t* - v* (#49544)
* Integration vizio: HomeAssistantType -> HomeAssistant.

* Integration velbus: HomeAssistantType -> HomeAssistant.

* Integration vacuum: HomeAssistantType -> HomeAssistant.

* Integration upnp: HomeAssistantType -> HomeAssistant.

* Integration upcloud: HomeAssistantType -> HomeAssistant.

* Integration twinkly: HomeAssistantType -> HomeAssistant.

* Integration tts: HomeAssistantType -> HomeAssistant.

* Integration tradfri: HomeAssistantType -> HomeAssistant.

* Integration traccar: HomeAssistantType -> HomeAssistant.

* Integration tplink: HomeAssistantType -> HomeAssistant.
2021-04-22 10:53:57 -04:00
Philip Allgaier f1c4072d3c Return TP-Link sensor & light attributes as float rather than string (#48828) 2021-04-08 16:51:59 +02:00
Mario Limonciello 9fd6980144 Avoid divide by zero errors in tplink light integration (#48235) 2021-03-31 17:16:24 +02:00
Franck Nijhof 8d5ce53098 Merge of nested IF-IF cases - S-W (#48372) 2021-03-27 10:54:59 +01:00
Marc Mueller b67b9b94f9 Update typing 13 (#48077) 2021-03-18 14:43:52 +01:00
Erik Montnemery 1fc8e32d86 Update integrations t-z to override extra_state_attributes() (#47760) 2021-03-11 20:16:26 +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
Angelo GaglianoandAnders Melchiorsen 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
Erik Montnemery e4333a7a44 Rename Light to LightEntity (#34593) 2020-04-26 18:49:41 +02: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
J. Nick Koston 6b2baae0de Fix tplink HS220 dimmers (#33909)
* HS220 dimmers are handled as lights with a limited feature set
2020-04-09 15:07:39 -07:00
Paulus SchoutsenandJ. Nick Koston df744c5944 Speed up TP-Link lights (#33606)
* Speed up TP-Link lights

* Color temp kan be None

* hs as int, force color temp=0

* Fix color temp?

* Additional tplink cleanups to reduce api calls

* Update test to return state, remove Throttle

* Fix state restore on off/on

* Fix lights without hue/sat

Co-authored-by: J. Nick Koston <nick@koston.org>
2020-04-08 14:36:45 -05:00
Paulus Schoutsen 8fb89854d3 Fix flaky TP-Link test (#33790) 2020-04-07 10:13:55 -07:00
Ville Skyttä ffc9bcb4d7 Use PEP 526 syntax with NamedTuples (#33081) 2020-03-21 11:18:32 +02:00
Robert Van Gorkom a0b0dc0aca Optimistically set tplink light states (#30189)
* Optimistically handling state changes.
Using retries when command fail.

* Fixing endless update loop.

* Address PR comments.
2020-01-12 03:45:01 +01:00
Robert Van Gorkom 78e831b08e Make tplink light more responsive (#28652)
* Making tplink light more responsive.

* Adding light platform tests.

* Addressing PR feedback.

* Mocking the module, not the api.

* Using sync method for background update.
2019-12-17 02:24:50 +01:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Robert Van Gorkom bf91a8c1b3 Fixing tplink issues with offline devices during setup (#23668)
* Fixing tplink issues with offline devices during setup.

* Fixing circleci errors.

* Adding code to defer the creation of entities that are not online.

* Addressing code review changes and cleaning up a little.

* Fixing tests and static analysis.

* Adding test to satisfy coverage requirements.

* Resolving merge conflicts.

* Fixing issue where lights don't appear in the integration page.

* Using pyHS100 properties for most sysinfo.
Addressing some PR feedback.

* Addressing some PR feedback.

* Better testing async_add_entities_retry
Testing for static dimmers.
Making greater use of conf constants.

* Fixing all static analysis issues.

* Adding non-blocking call for getting discovering devices.

* Address PR feedback
2019-05-31 01:51:04 -04:00