Commit Graph

11 Commits (dc0d065901096612a608c91acf2d0ea50df19a41)

Author SHA1 Message Date
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
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
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
Teemu R 8fb0da7720
Stopgap fix for inconsistent upstream API of tplink dimmers (#57285) 2021-10-07 20:15:13 -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
Teemu R 94be43e3e1 Add support for automatic discovery of TP-Link switches, bulbs and dimmers (#18091)
* {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