* Reduce overhead to refire events
- asyncio timers can fire early for a varity of reasons including
poor clock resolution and performance. To solve this problem
we re-arm async_track_point_in_utc_time and try again later
when this happens.
- On some platforms this means the async_track_point_in_utc_time can
end up trying many times to prevent firing the timer early since as
soon as it rearms it fires again and this repeats until we reach
the appointed time. While there is not much we can do to prevent
asyncio from firing the timer callback early, we can reduce the
overhead when this happens by using avoiding creating datetime
objects
* tweak mocking
* -vvv
* fix time freeze being too broad in litterrobot
* adjust
* Add temperature unit conversion to number
* Remove type enforcements
* Lint
* Fix legacy unit_of_measurement
* Address review comments
* Fix unit_of_measurement, improve test coverage
* Use more specific exception for comms timeout
* Remove defered uniqueid assigner now yaml has gone
Co-authored-by: Dave T <davet2001@users.noreply.github.com>
* Partially revert #70458 and allow duplicate LIFX discoveries
Signed-off-by: Avi Miller <me@dje.li>
* Only process one discovery at a time
* Revert all LIFX duplicate/inflight discovery checks
Also remember LIFX Switches and do as little processing for them
as possible.
Signed-off-by: Avi Miller <me@dje.li>
* Bump aiolifx version to support the latest LIFX devices
LIFX added 22 new product definitions to their public product
list at the end of January and those new products are defined in
aiolifx v0.8.1, so bump the dependency version.
Also switched to testing for relays instead of maintaining a
seperate list of switch product IDs.
Fixes#72894.
Signed-off-by: Avi Miller <me@dje.li>
* Refactor LIFX discovery to better handle duplicate responses
Signed-off-by: Avi Miller <me@dje.li>
* Update clear_inflight_discovery with review suggestion
Signed-off-by: Avi Miller <me@dje.li>
* Move the existing entity check to before the asyncio lock
Signed-off-by: Avi Miller <me@dje.li>
* Bail out of discovery early and if an entity was created
Also ensure that the entity always has a unique ID even if the bulb was
not successfully discovered.
Signed-off-by: Avi Miller <me@dje.li>
Co-authored-by: J. Nick Koston <nick@koston.org>