Selectors 已扩展,现在也包含了 CountrySelector。
CountrySelector
在config flows中使用它可以让 frontend 自动将国家代码翻译成正确的国家名称。
示例:
vol.Schema( { vol.Optional(CONF_COUNTRY): CountrySelector( CountrySelectorConfig( countries=["DE", "US"], ) ), } )