Skip to content

Commit

Permalink
Use the default values stored in the config flow instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Jalle19 committed Sep 10, 2024
1 parent 206062a commit af7ac9b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions custom_components/vinx/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@
class VinxConfigFlow(ConfigFlow, domain=DOMAIN):
VERSION = 1

def __init__(self):
# Potentially prepopulated values (e.g. during auto-discovery)
self.host: str | None = None
self.port: int = 6107

@property
def schema(self):
return vol.Schema(
{
vol.Required(CONF_HOST): str,
vol.Required(CONF_PORT, default=6107): int,
vol.Required(CONF_HOST, default=self.host): str,
vol.Required(CONF_PORT, default=self.port): int,
}
)

Expand Down

0 comments on commit af7ac9b

Please sign in to comment.