* 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>
- 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.
- 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
* 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
* Optimize tplink i/o
* Cache has_emeter reduceing the number of i/o requests on hs300 by 5
* Use the state from the sysinfo dict for non-strips reducing required requests by one
* Remove I/O from __init__, read has_emeter from sysinfo
* Cleanup __init__ to avoid I/O
* Re-use the sysinfo response for has_emeter
* Use async_add_executor_job() to execute the synchronous I/O ops.
* use the device alias instead of host for coordinator, use executor for unavailable_devices
* Remove unnecessary self.hass assignment
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Add retries for tplink discovery
* Black Format tplink common.py
* Exit tplink discovery early if all devices found
* Fix typo in tplink retry log msg
* Code style cleanup for tplink retries
* Update homeassistant/components/tplink/common.py
Co-authored-by: Teemu R. <tpr@iki.fi>
* Fix linting errors for tplink retries
Co-authored-by: Teemu R. <tpr@iki.fi>