Allow configuring country and language in core config (#81734)

* Allow configuring country and language in core config

* Add script for updating list of countries

* Use black for formatting

* Fix quoting

* Move country codes to a separate file

* Address review comments

* Add generated/countries.py

* Get default language from owner account

* Remove unused variable

* Add script to generate list of supported languages

* Add tests

* Fix stale docsring

* Use format_python_namespace

* Correct async_user_store

* Improve typing

* Fix with_store decorator

* Initialize language in core store migration

* Fix startup

* Tweak

* Apply suggestions from code review

Co-authored-by: Franck Nijhof <git@frenck.dev>

* Update storage.py

Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
Erik Montnemery 2022-11-24 23:25:50 +01:00 committed by GitHub
parent 09c3df7eb2
commit e1338adf1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 623 additions and 37 deletions

View file

@ -60,6 +60,8 @@ async def test_websocket_core_update(hass, client):
assert hass.config.external_url != "https://www.example.com"
assert hass.config.internal_url != "http://example.com"
assert hass.config.currency == "EUR"
assert hass.config.country != "SE"
assert hass.config.language != "sv"
with patch("homeassistant.util.dt.set_default_time_zone") as mock_set_tz:
await client.send_json(
@ -75,6 +77,8 @@ async def test_websocket_core_update(hass, client):
"external_url": "https://www.example.com",
"internal_url": "http://example.local",
"currency": "USD",
"country": "SE",
"language": "sv",
}
)