Skip to content

Commit

Permalink
Update config_flow.py
Browse files Browse the repository at this point in the history
  • Loading branch information
aunefyren committed Feb 4, 2024
1 parent fa538ee commit 9e53fbe
Showing 1 changed file with 16 additions and 19 deletions.
35 changes: 16 additions & 19 deletions custom_components/bluesound_alt/config_flow.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,24 @@
from homeassistant.helpers.selector import selector
from homeassistant import config_entries
import voluptuous as vol


from .const import DOMAIN

class BluesoundConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Bluesound."""

def __init__(self):
"""Initialize a new AppleTVConfigFlow."""
self.ip = None
self.name = None

class BluesoundConfigFlow(data_entry_flow.FlowHandler):
async def async_step_user(self, user_input=None):
"""Handle the initial step."""
errors = {}

return self.async_show_form(
step_id="user",
step_id="init",
data_schema=vol.Schema(
{
vol.Required("Name"): str
Expand All @@ -15,20 +27,5 @@ async def async_step_user(self, user_input=None):
vol.Required("IP"): str
}
),
errors=errors,
)

async def async_create_player(self, user_input=None):
return self.async_create_entry(
title="Title of the entry",
data={
"username": user_input["username"],
"password": user_input["password"]
},
options={
"mobile_number": user_input["mobile_number"]
},
)

async def create_player_object()
player = BluesoundPlayer(HomeAssistant, host, port, name, _add_player_cb)
errors=errors
)

0 comments on commit 9e53fbe

Please sign in to comment.