From 010521af6839fe0f04381ca60253ae8a3873eaf1 Mon Sep 17 00:00:00 2001 From: G Johansson Date: Wed, 25 Oct 2023 07:04:10 +0200 Subject: [PATCH] Blog country selector (#1948) --- blog/2023-10-12-country_selector.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 blog/2023-10-12-country_selector.md diff --git a/blog/2023-10-12-country_selector.md b/blog/2023-10-12-country_selector.md new file mode 100644 index 00000000..f28a84ae --- /dev/null +++ b/blog/2023-10-12-country_selector.md @@ -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"], + ) + ), + } +) +```