* Index config entry discovery_keys by discovery domain
* Add new signal
* Update tests
* Update homeassistant/config_entries.py
Co-authored-by: J. Nick Koston <nick@koston.org>
* Fix imports
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* Reinitialize zeroconf discovery flow on unignore
* Adjust tests
* Improve comments
* Fix logic for updating discovery keys
* Add tests
* Use mock_config_flow helper in new config_entries test
* Add discovery_keys attribute to ConfigEntry
* Update zeroconf rediscovery
* Change type of ConfigEntry.discovery_keys
* Update tests
* Fix DiscoveryKey.from_json_dict and add tests
* Fix test
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* Always do thread safety check when writing state
Refactor the 3 most common places where the thread safety check
for the event loop to be inline to make the check fast enough
that we can keep it long term. While code review catches most
of the thread safety issues in core, some of them still make
it through, and new ones keep getting added. Its not possible
to catch them all with manual code review, so its worth the
tiny overhead to check each time.
Previously the check was limited to custom components
because they were the most common source of thread
safety issues.
* Always do thread safety check when writing state
Refactor the 3 most common places where the thread safety check
for the event loop to be inline to make the check fast enough
that we can keep it long term. While code review catches most
of the thread safety issues in core, some of them still make
it through, and new ones keep getting added. Its not possible
to catch them all with manual code review, so its worth the
tiny overhead to check each time.
Previously the check was limited to custom components
because they were the most common source of thread
safety issues.
* async_fire is more common than expected with ccs
* fix mock
* fix hass mocking
* Add thread safety checks to async_create_task
Calling async_create_task from a thread almost always results in an
fast crash. Since most internals are using async_create_background_task
or other task APIs, and this is the one integrations seem to get wrong
the most, add a thread safety check here
* Add thread safety checks to async_create_task
Calling async_create_task from a thread almost always results in an
fast crash. Since most internals are using async_create_background_task
or other task APIs, and this is the one integrations seem to get wrong
the most, add a thread safety check here
* missed one
* Update homeassistant/core.py
* fix mocks
* one more internal
* more places where internal can be used
* more places where internal can be used
* more places where internal can be used
* internal one more place since this is high volume and was already eager_start