Blog country selector (#1948)

This commit is contained in:
G Johansson 2023-10-25 07:04:10 +02:00 committed by GitHub
parent 204966dba4
commit 010521af68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,23 @@
---
author: G Johansson
authorURL: https://github.com/gjohansson-ST
title: "Country selector"
---
[Selectors](https://www.home-assistant.io/docs/blueprint/selectors/) has been expanded and now also includes a `CountrySelector`.
Using this in [config flows](/docs/data_entry_flow_index#show-form) will allow frontend to automatically translate the country codes into the proper country names.
Example:
```python
vol.Schema(
{
vol.Optional(CONF_COUNTRY): CountrySelector(
CountrySelectorConfig(
countries=["DE", "US"],
)
),
}
)
```