feat: Enable config flow
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
"""Config flow for Coronavirus Hessen integration."""
|
||||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
from homeassistant import config_entries
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
"""Handle a config flow for Coronavirus Hessen."""
|
||||
|
||||
VERSION = 1
|
||||
CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL
|
||||
|
||||
async def async_step_user(self, user_input=None):
|
||||
"""Handle the initial step."""
|
||||
if user_input is not None:
|
||||
await self.async_set_unique_id("augsburg")
|
||||
self._abort_if_unique_id_configured()
|
||||
return self.async_create_entry(title="COVID-19 Augsburg", data=user_input)
|
||||
|
||||
_LOGGER.debug("Showing config form")
|
||||
return self.async_show_form(
|
||||
step_id="user",
|
||||
data_schema=vol.Schema({}),
|
||||
)
|
||||
@@ -2,7 +2,7 @@
|
||||
"domain": "covid19_augsburg",
|
||||
"name": "COVID-19 Augsburg",
|
||||
"version": "0.1.0",
|
||||
"config_flow": false,
|
||||
"config_flow": true,
|
||||
"documentation": "https://github.com/AdrianoKF/home-assistant-covid19-augsburg",
|
||||
"requirements": ["beautifulsoup4==4.8.2", "requests==2.25.1"],
|
||||
"dependencies": [],
|
||||
|
||||
Reference in New Issue
Block a user