include const for username and password for use in dev

This commit is contained in:
Yordan Suarez
2022-07-24 02:45:05 -04:00
parent a784fd314a
commit 4caa8ce8ac
2 changed files with 11 additions and 3 deletions

View File

@@ -8,7 +8,7 @@ from homeassistant.helpers.aiohttp_client import async_create_clientsession
from homeassistant.core import callback from homeassistant.core import callback
from homeassistant.const import CONF_USERNAME, CONF_PASSWORD, CONF_NAME from homeassistant.const import CONF_USERNAME, CONF_PASSWORD, CONF_NAME
from .const import DOMAIN from .const import DEFAULT_CONF_PASSWORD, DEFAULT_CONF_USERNAME, DOMAIN
from .fplapi import ( from .fplapi import (
LOGIN_RESULT_OK, LOGIN_RESULT_OK,
@@ -18,6 +18,11 @@ from .fplapi import (
FplApi, FplApi,
) )
try:
from .secrets import DEFAULT_CONF_PASSWORD, DEFAULT_CONF_USERNAME
except:
pass
@callback @callback
def configured_instances(hass): def configured_instances(hass):
@@ -86,8 +91,8 @@ class FplFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
async def _show_config_form(self, user_input): async def _show_config_form(self, user_input):
"""Show the configuration form to edit location data.""" """Show the configuration form to edit location data."""
username = "" username = DEFAULT_CONF_USERNAME
password = "" password = DEFAULT_CONF_PASSWORD
if user_input is not None: if user_input is not None:
if CONF_USERNAME in user_input: if CONF_USERNAME in user_input:

View File

@@ -47,3 +47,6 @@ If you have any issues with this you need to open an issue here:
{ISSUE_URL} {ISSUE_URL}
------------------------------------------------------------------- -------------------------------------------------------------------
""" """
DEFAULT_CONF_USERNAME = ""
DEFAULT_CONF_PASSWORD = ""