Rename IMPERIAL_SYSTEM to US_CUSTOMARY_SYSTEM (#80253)

* Rename IMPERIAL_SYSTEM

* Deprecate is_metric property and adjust tests

* Adjust unit_system config validation

* Add yaml tests

* Add tests for private name

* Fix incorrect rebase

* Adjust docstring

* Add store migration

* Update unit_system.py

* Minimise test tweaks

* Fix tests

* Add conversion to migration

* Rename new key and adjust tests

* Adjust websocket_detect_config

* Move original_unit_system tracking to subclass
This commit is contained in:
epenet
2022-10-19 13:31:08 +02:00
committed by GitHub
parent f4951a4f31
commit 67d1dde69f
5 changed files with 125 additions and 22 deletions

View File

@@ -94,7 +94,7 @@ async def websocket_detect_config(
info["unit_system"] = unit_system._CONF_UNIT_SYSTEM_METRIC
else:
# pylint: disable-next=protected-access
info["unit_system"] = unit_system._CONF_UNIT_SYSTEM_IMPERIAL
info["unit_system"] = unit_system._CONF_UNIT_SYSTEM_US_CUSTOMARY
if location_info.latitude:
info["latitude"] = location_info.latitude