Switch rfxtrx to config entries (#37794)
* Switch to config flow setup * Add minimal test for config flow * Add myself as codeowner and address some review concerns * Address some further review comments
This commit is contained in:
parent
ed3f25489e
commit
1a64108eea
13 changed files with 228 additions and 71 deletions
22
homeassistant/components/rfxtrx/config_flow.py
Normal file
22
homeassistant/components/rfxtrx/config_flow.py
Normal file
|
@ -0,0 +1,22 @@
|
|||
"""Config flow for RFXCOM RFXtrx integration."""
|
||||
import logging
|
||||
|
||||
from homeassistant import config_entries
|
||||
|
||||
from . import DOMAIN
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
"""Handle a config flow for RFXCOM RFXtrx."""
|
||||
|
||||
VERSION = 1
|
||||
CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_PUSH
|
||||
|
||||
async def async_step_import(self, import_config=None):
|
||||
"""Handle the initial step."""
|
||||
|
||||
await self.async_set_unique_id(DOMAIN)
|
||||
self._abort_if_unique_id_configured(import_config)
|
||||
return self.async_create_entry(title="RFXTRX", data=import_config)
|
Loading…
Add table
Add a link
Reference in a new issue