Add a configflow
This commit is contained in:
@@ -13,14 +13,16 @@ from homeassistant.core import callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.setup import async_when_setup
|
||||
|
||||
from .const import (
|
||||
DOMAIN,
|
||||
CONF_EMAIL,
|
||||
CONF_PASSWORD,
|
||||
TRACKER_ID
|
||||
)
|
||||
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DOMAIN = "georide"
|
||||
CONF_EMAIL = "email"
|
||||
CONF_PASSWORD = "password"
|
||||
|
||||
TRACKER_ID = "trackerId"
|
||||
|
||||
CONFIG_SCHEMA = vol.Schema(
|
||||
{
|
||||
|
||||
14
custom_components/georide/config_flow.py
Normal file
14
custom_components/georide/config_flow.py
Normal file
@@ -0,0 +1,14 @@
|
||||
from homeassistant import config_entries
|
||||
from .const import DOMAIN
|
||||
|
||||
class GeorideConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
async def async_step_user(self, info):
|
||||
if info is not None:
|
||||
# process info
|
||||
|
||||
return self.async_show_form(
|
||||
step_id='user',
|
||||
data_schema=vol.Schema({
|
||||
vol.Required('password'): str
|
||||
})
|
||||
)
|
||||
7
custom_components/georide/const.py
Normal file
7
custom_components/georide/const.py
Normal file
@@ -0,0 +1,7 @@
|
||||
""" Georide const file """
|
||||
|
||||
DOMAIN = "georide"
|
||||
CONF_EMAIL = "email"
|
||||
CONF_PASSWORD = "password"
|
||||
|
||||
TRACKER_ID = "trackerId"
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"domain": "georide",
|
||||
"name": "Georide",
|
||||
"config_flow": false,
|
||||
"config_flow": true,
|
||||
"documentation": "https://git.tontontux.fr/mduval/GeorideHA",
|
||||
"requirements": [
|
||||
"georideapilib==0.1.0"
|
||||
],
|
||||
"dependencies": [
|
||||
"urllib3",
|
||||
"urllib3, georideapilib",
|
||||
],
|
||||
"codeowners": ["ptimatth"]
|
||||
}
|
||||
Reference in New Issue
Block a user