Add reauth to SFR Box (#86511)
This commit is contained in:
parent
e084fe4903
commit
22dee1f92b
7 changed files with 144 additions and 9 deletions
|
@ -8,7 +8,7 @@ from sfrbox_api.models import DslInfo, SystemInfo
|
|||
|
||||
from homeassistant.components.sfr_box.const import DOMAIN
|
||||
from homeassistant.config_entries import SOURCE_USER, ConfigEntry
|
||||
from homeassistant.const import CONF_HOST
|
||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
|
||||
from tests.common import MockConfigEntry, load_fixture
|
||||
|
@ -29,6 +29,25 @@ def get_config_entry(hass: HomeAssistant) -> ConfigEntry:
|
|||
return config_entry
|
||||
|
||||
|
||||
@pytest.fixture(name="config_entry_with_auth")
|
||||
def get_config_entry_with_auth(hass: HomeAssistant) -> ConfigEntry:
|
||||
"""Create and register mock config entry."""
|
||||
config_entry_with_auth = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
source=SOURCE_USER,
|
||||
data={
|
||||
CONF_HOST: "192.168.0.1",
|
||||
CONF_USERNAME: "admin",
|
||||
CONF_PASSWORD: "password",
|
||||
},
|
||||
unique_id="e4:5d:51:00:11:23",
|
||||
options={},
|
||||
entry_id="1234567",
|
||||
)
|
||||
config_entry_with_auth.add_to_hass(hass)
|
||||
return config_entry_with_auth
|
||||
|
||||
|
||||
@pytest.fixture()
|
||||
def system_get_info() -> Generator[SystemInfo, None, None]:
|
||||
"""Fixture for SFRBox.system_get_info."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue