* Improve recorder history queries
* Remove some comments
* Update StatesManager._oldest_ts when adding pending state
* Update after review
* Improve tests
* Improve post-purge logic
* Avoid calling dt_util.utc_to_timestamp in new code
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* area conversions
* start work on tests
* add number device class
* update unit conversions to utilise distance constants
* add area unit
* update test unit system
* update device condition and trigger
* update statistic unit converters
* further tests work WIP
* update test unit system
* add missing string translations
* fix websocket tests
* add deprecated notice
* add more missing strings and missing initialisation of unit system
* adjust icon and remove strings from scrape and random
* Fix acre to meters conversion
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Tidy up valid units
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* fix ordering of area
* update order alphabetically
* fix broken test
* update test_init
* Update homeassistant/const.py
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* remove deprecated unit and fix alphabetical order
* change deprecation and add tests, change to millimeter conversion for inches
* fix order
* re-order defs alphabetically
* add measurement as well
* update icons
* fix up Deprecation of area square meters
* Update core integrations to UnitOfArea
* update test recorder tests
* unit system tests in alphabetical
* update snapshot
* rebuild
* revert alphabetization of functions
* other revert of alphabetical order
---------
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
* Make statistics validation create issue registry issues
* Disable creating issue about outdated MariaDB version in tests
* Use call_soon_threadsafe instead of run_callback_threadsafe
* Update tests
* Fix flapping test
* Disable creating issue about outdated SQLite version in tests
* Implement agreed changes
* Add translation strings for issue titles
* Update test
* Close database connection before stopping the executor
related issue #117004
* Close database connection before waiting for database executor to finish
related issue #117004
* fix test
* fix
* drop unused arg
* Revert "drop unused arg"
This reverts commit 8a9fe6a24a.
* docstring
* comment
* Raise on database error in recorder.migration._drop_foreign_key_constraints
* Fix test
* Fix test
* Revert "Fix test"
This reverts commit 940b8cb506e912826d43d09d7697c10888bdf685.
* Update test
* Improve test coverage
* Disable test for SQLite
* Drop violating rows before adding foreign constraints
* Don't delete rows with null-references
* Only delete rows when integrityerror is caught
* Move restore of dropped foreign key constraints to a separate migration step
* Use aliases for tables
* Update homeassistant/components/recorder/migration.py
* Update test
* Don't use alias for table we're deleting from, improve test
* Fix MySQL
* Update instead of deleting in case of self references
* Improve log messages
* Batch updates
* Add workaround for unsupported LIMIT in PostgreSQL
* Simplify
---------
Co-authored-by: J. Nick Koston <nick@koston.org>