Set unique on StatesMeta and EventTypes
These should have been marked unique originally to prevent
collision bugs from going unnoticed. These have not been
to beta yet so this is not a breaking change
* Fix cpu thrashing during purge after all legacy events were removed
We now remove the the index of of event ids on the states table when its
all NULLs to save space. The purge path needs to avoid checking for legacy
rows to purge if the index has been removed since it will result in a full
table scan each purge cycle that will always find no legacy rows to purge
* one more place
* drop the key constraint as well
* fixes
* more sqlite
* Avoid database executor job to fetch statistic metadata on cache hit
Since we will almost always have a cache hit fetching
statistic meta data we can avoid an executor job
* Avoid database executor job to fetch statistic metadata on cache hit
Since we will almost always have a cache hit fetching
statistic meta data we can avoid an executor job
* Avoid database executor job to fetch statistic metadata on cache hit
Since we will almost always have a cache hit fetching
statistic meta data we can avoid an executor job
* remove exception catch since the threading.excepthook will actually catch this in production
* fix a few missed ones
* threadsafe
* Update homeassistant/components/recorder/table_managers/statistics_meta.py
* coverage and optimistic caching
* Add state attribute translations for media players
* Process review comments
* Process review comments
* Fix and extend
* Add yes/no as generic state
* Warn if the previous push wait task it taking longer than the update interval
* refactor
* Call _async_fetch_number_of_messages first
* Add cleanup in case fetching fails
* mypy
* Set sensor to unknown if an error occured.
* Handling invalid auth an reraise when needed
* Handle invalid folder as setup error
* Close IMAP stream before logout at cleanup
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add local calendar diagnostics platform
* Use redaction from ical
* Update diagnostics for new ical version
* Apply suggestions from code review
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Use snapshot tests for local calendar diagnostics
* Setup diagnostics directly in tests rather than via dependencies
---------
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>