1
0
mirror of https://github.com/home-assistant/core.git synced 2025-05-28 01:37:07 +00:00

49 Commits

Author SHA1 Message Date
epenet
d58430bc93
Use light enums in tplink () 2022-04-26 14:54:17 +02:00
epenet
121d2008c2
Use ColorMode enum in tplink () 2022-04-23 09:46:54 -10:00
J. Nick Koston
689b347904
Increase tplink effects random seed allowed range to 1-600 ()
* 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 () 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 () 2022-04-05 13:46:12 -07:00
J. Nick Koston
fb41734342
Add support for custom effects to tplink light strips () 2022-03-30 09:34:09 -07:00
J. Nick Koston
49bc572d6d
Fix tplink effect not being restored when turning back on ()
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 () 2022-03-21 20:20:40 -10:00
J. Nick Koston
16655c4ccc
Fix tplink color temp conversion () 2022-03-21 12:41:15 -10:00
Marc Mueller
add741d789
Update coordinator typing (6) [t-v] () 2022-03-21 14:20:35 +01:00
Teemu R
c985ebb3a7
Bump python-kasa to 0.4.1 for tplink integration ()
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 () 2021-10-10 00:02:33 -07:00
Teemu R
8fb0da7720
Stopgap fix for inconsistent upstream API of tplink dimmers () 2021-10-07 20:15:13 -07:00
Teemu R
36a22400e5
Fix transition handling for tplink lights ()
* 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 () 2021-10-07 10:14:14 -10:00
Teemu R
b40d229369
Rework TPLink integration to use python-kasa ()
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 () 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 () 2021-06-29 19:14:34 +02:00
Franck Nijhof
560dd0a0cc
Typing improvements for TPLink ()
* 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 ()
This fixes issue  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 ()
* 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* ()
* 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 () 2021-04-08 16:51:59 +02:00
Mario Limonciello
9fd6980144
Avoid divide by zero errors in tplink light integration () 2021-03-31 17:16:24 +02:00
Franck Nijhof
8d5ce53098
Merge of nested IF-IF cases - S-W () 2021-03-27 10:54:59 +01:00
Marc Mueller
b67b9b94f9
Update typing 13 () 2021-03-18 14:43:52 +01:00
Erik Montnemery
1fc8e32d86
Update integrations t-z to override extra_state_attributes() () 2021-03-11 20:16:26 +01:00
Angelo Gagliano
d42bdcfc2a
Move async_add_entities back to event loop for tplink component () 2020-10-28 09:51:53 +01:00
Angelo Gagliano
34283ac283
Add retry for unavailable static tplink devices after HA starts () 2020-10-27 10:02:16 +01:00
Angelo Gagliano
874e1f6103
Prevent tplink missing devices and unavailable state ()
* 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 () 2020-08-27 13:56:20 +02:00
Erik Montnemery
e4333a7a44
Rename Light to LightEntity () 2020-04-26 18:49:41 +02:00
J. Nick Koston
f516b24dfb
Reduce tplink loss of precision during brightness conversion () 2020-04-14 20:48:35 +02:00
J. Nick Koston
a000af5c03
Fix tplink HS220 dimmers (round 2) ()
* 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 ()
* HS220 dimmers are handled as lights with a limited feature set
2020-04-09 15:07:39 -07:00
Paulus Schoutsen
df744c5944
Speed up TP-Link lights ()
* 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 () 2020-04-07 10:13:55 -07:00
Ville Skyttä
ffc9bcb4d7
Use PEP 526 syntax with NamedTuples () 2020-03-21 11:18:32 +02:00
Robert Van Gorkom
a0b0dc0aca Optimistically set tplink light states ()
* 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 ()
* 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 ()
* 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
Teemu R
39264af310 Add missing async for tplink's async_setup_platform methods ()
* add missing async for tplink's async_setup_platform methods

thanks to @MartinHjelmare for spotting this, related to 

* fix line lengths
2019-04-13 23:50:21 +02:00
cgtobi
2c07bfb9e0 Remove dependencies and requirements ()
* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit fe7171b4cd30889bad5adc9a4fd60059d05ba5a7.

* Remove dependencies and requirements

* Revert "Remove dependencies and requirements"

This reverts commit 391355ee2cc53cbe6954f940062b18ae34b05621.

* Remove dependencies and requirements

* Fix flake8 complaints

* Fix more flake8 complaints

* Revert non-component removals
2019-04-12 10:13:30 -07:00
Tobias Sauerwein
048b100eea Clean up docstrings ()
* Clean up docstrings

* Fix long lines

* Fix more docstrings

* Fix more docstrings

* Fix more docstrings
2019-04-03 17:40:03 +02:00
Paulus Schoutsen
4b1de61110
Use relative imports inside integrations ()
* Use relative imports inside integrations

* Lint

* Fix automation tests

* Fix scene imports
2019-03-20 22:56:46 -07:00
Anders Melchiorsen
5eab86986e Word the tplink deprecation warning more strongly () 2019-03-02 12:32:18 +01:00
Teemu R
492c3b24de Check for attribute existence for HS220 support ()
* Check for attribute existence as smartplug does not have them (for HS220 support)

* use getattr over hasattr and a separate check
2019-02-23 22:57:54 +01:00
Teemu R
94be43e3e1 Add support for automatic discovery of TP-Link switches, bulbs and dimmers ()
* {switch,light}.tplink: use deviceid as unique id, fetch name from the device during initialization

* raise PlatformNotReady when no device is available

* Use mac instead of deviceid

* remove name option as obsolete

* Add support for configuration flow / integration

Allows activating automatic discovery of supported devices from the configuration

* Fix linting, update requirements_all.txt

* start cleaning up tplink component based on feedback

* add device info, improve config handling

* Allow overriding detected devices via configuration file

* Update requirements.txt

* Remove debug logging

* make hound happy

* Avoid I/O during init and simplify the code, remove remains of leds_on

* Fix issues based on feedback, use consistent quotation marks for device info

* add async_setup_platform emiting a deprecation warning

* Avoid blocking the I/O, check for None on features

* handle some Martin's comments, schema-validation is still missing

* use async_create_task instead of async_add_job, let core validate the schema

* simplify configuration handling by storing the configuration data separately from initialized instances

* add default values to schema, make hound happy

* with defaults set by schema, simplify the checks. add async_unload_entry

* Use constant for data structure access

* REWORD add a short note about async_unload_entry

* handle feedback from Martin, config_data is checked against Noneness

* use pop to remove the domain on unload

* First steps to add tests for the new tplink component

* embed platforms under the component directory

* Fix tests by mocking the pyhs100 internals

* Fix linting

* Test against multiple instances of devices, tidy up

* (hopefully) final linting round

* Add pyHS100 to test requirements

* log always the warnings occured during an update to make them easy to see

* revert back the warning behavior (requirement for silver level in IQS)

* Unload only when an entry is being loaded and add tests for that

Thanks @MartinHjelmare for pointing this out!

* Fix linting

* Bump the upstream lib, fixes most prominently the HSV setting on bulbs

* Test unloading for all platforms, clear the data storage instead of popping it out, making it possible to reconfigure after removal without restarting hass first

* Use class variables instead of instance variables for bulb states, required for HS220

* Use new-style format string

* Fix indenting, uppercase the mock constant

* Run black on test_init, hopefully that will finally fix the weird formatting (pycharm, pylint and hound seems to have different opinions...)
2019-02-21 20:29:07 +01:00