* Add circular mean statistics
* fixes
* Add has_circular_mean and fix tests
* Fix mypy
* Rename to MEASUREMENT_ANGLE
* Fix kitchen_sink tests
* Fix sensor tests
* for testing only
* Revert ws command change
* Apply suggestions
* test only
* add custom handling for postgres
* fix recursion limit
* Check if column is already available
* Set default false and not nullable for has_circular_mean
* Proper fix to be backwards compatible
* Fix value is None
* Align with schema
* Remove has_circular_mean from test schemas as it's not required anymore
* fix wrong column type
* Use correct variable to reduce stats
* Add guard that the uom is matching a valid one from the state class
* Add some tests
* Fix tests again
* Use mean_type in StatisticsMetato difference between different mean type algorithms
* Fix leftovers
* Fix kitchen_sink tests
* Fix postgres
* Add circular mean test
* Add mean_type_changed stats issue
* Align the attributes with unit_changed
* Fix mean_type_change stats issue
* Add missing sensor recorder tests
* Add test_statistic_during_period_circular_mean
* Add mean_weight
* Add test_statistic_during_period_hole_circular_mean
* Use seperate migration step to null has_mean
* Typo ARITHMETIC
* Implement requested changes
* Implement requested changes
* Split into #141444
* Add StatisticMeanType.NONE and forbid that mean_type can be None
* Fix mean_type
* Implement requested changes
* Small leftover of latest StatisticMeanType changes
* Make helpers.frame.report_usage work when called from any thread
* Address review comments, update tests
* Add test
* Update test
* Update recorder test
* Update tests
* tweaks
* mysql
* mysql
* Update homeassistant/components/recorder/history/modern.py
* Update homeassistant/components/recorder/history/modern.py
* Update homeassistant/components/recorder/const.py
* Update homeassistant/components/recorder/statistics.py
* Apply suggestions from code review
* mysql
* mysql
* cover
* make sure db is fully init on old schema
* fixes
* fixes
* coverage
* coverage
* coverage
* s/slow_dependant_subquery/slow_dependent_subquery/g
* reword
* comment that callers are responsible for staying under the limit
* comment that callers are responsible for staying under the limit
* switch to kwargs
* reduce branching complexity
* split stats query
* preen
* split tests
* split tests
* Fix minimum version to run event_id_post_migration
The table rebuild to fix the foreign key constraint was added
in https://github.com/home-assistant/core/pull/120779 but the
schema version was not bumped so we need to make sure
any database that was created with schema 43 or older
still has the migration run as otherwise they will not
be able to purge the database with SQLite since each
delete in the events table will due a full table scan
of the states table to look for a foreign key that is
not there
fixes#138818
* Apply suggestions from code review
* Update homeassistant/components/recorder/migration.py
* Update homeassistant/components/recorder/migration.py
* Update homeassistant/components/recorder/const.py
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* Apply suggestions from code review
* update tests, add more cover
* update tests, add more cover
* Update tests/components/recorder/test_migration_run_time_migrations_remember.py
* Ensure indices needed by data migrators exist
* Update test
* Improve test
* Ignore index error on char(0) columns
* Adjust tests
* Address review comments
* Add comment motivating magic number
* FIX: make "year" period work in leap year
* Add test
* Set second and microsecond to non-zero in test start times
* FIX: better fix for leap year problem
* Revert "FIX: better fix for leap year problem"
This reverts commit 06aba46ec6a0a1e944c88fe99d9bc6181a73cc1c.
---------
Co-authored-by: Erik <erik@montnemery.com>
* 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>