Update custom_components/aurora_solar/config_flow.py
This commit is contained in:
@@ -0,0 +1,19 @@
|
|||||||
|
class AuroraSolarConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
|
async def async_step_user(self, user_input=None):
|
||||||
|
errors = {}
|
||||||
|
if user_input is not None:
|
||||||
|
return self.async_create_entry(
|
||||||
|
title=f"Aurora Wechselrichter {user_input[CONF_SLAVE_ID]}",
|
||||||
|
data=user_input
|
||||||
|
)
|
||||||
|
|
||||||
|
return self.async_show_form(
|
||||||
|
step_id="user",
|
||||||
|
data_schema=vol.Schema({
|
||||||
|
vol.Required(CONF_HOST): str,
|
||||||
|
vol.Required(CONF_PORT, default=DEFAULT_PORT): int,
|
||||||
|
vol.Required(CONF_SLAVE_ID, default=DEFAULT_SLAVE_ID): int,
|
||||||
|
vol.Required("name"): str,
|
||||||
|
}),
|
||||||
|
errors=errors
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user