parent
94f97e4917
commit
62dde71161
@ -1,16 +1,21 @@
|
||||
""" Georide config flow file """
|
||||
""" Georide config flow """
|
||||
|
||||
from homeassistant import config_entries
|
||||
import voluptuous as vol
|
||||
|
||||
from .const import DOMAIN
|
||||
from .const import DOMAIN, CONF_EMAIL, CONF_PASSWORD
|
||||
|
||||
STEP_ID = 'user'
|
||||
|
||||
class GeorideConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
"""Geride config flow """
|
||||
async def async_step_user(self, info):
|
||||
return self.async_show_form(
|
||||
step_id='user',
|
||||
data_schema=vol.Schema({
|
||||
vol.Required('password'): str
|
||||
|
||||
async def async_step_user(self, user_input=None):
|
||||
""" handle info to help to configure georide """
|
||||
if user_input is None:
|
||||
return self.async_show_form(step_id=STEP_ID, data_schema=vol.Schema({
|
||||
vol.Required(CONF_EMAIL): vol.All(str, vol.Length(min=3)),
|
||||
vol.Required(CONF_PASSWORD): vol.All(str)
|
||||
}))
|
||||
# process info
|
||||
|
@ -0,0 +1,17 @@
|
||||
{
|
||||
"config": {
|
||||
"title": "Georide",
|
||||
"step": {
|
||||
"user": {
|
||||
"title": "Set up Georide",
|
||||
"description": "Are you sure you want to set up OwnTracks?"
|
||||
}
|
||||
},
|
||||
"abort": {
|
||||
"one_instance_allowed": "Only a single instance is allowed."
|
||||
},
|
||||
"create_entry": {
|
||||
"default": "\n\nJust give your credentials"
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue