mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Make jellyfin not single config entry (#147656)
This commit is contained in:
parent
0b5d2ab8e4
commit
5c0f2d37f0
@ -7,6 +7,5 @@
|
||||
"integration_type": "service",
|
||||
"iot_class": "local_polling",
|
||||
"loggers": ["jellyfin_apiclient_python"],
|
||||
"requirements": ["jellyfin-apiclient-python==1.10.0"],
|
||||
"single_config_entry": true
|
||||
"requirements": ["jellyfin-apiclient-python==1.10.0"]
|
||||
}
|
||||
|
@ -3159,8 +3159,7 @@
|
||||
"name": "Jellyfin",
|
||||
"integration_type": "service",
|
||||
"config_flow": true,
|
||||
"iot_class": "local_polling",
|
||||
"single_config_entry": true
|
||||
"iot_class": "local_polling"
|
||||
},
|
||||
"jewish_calendar": {
|
||||
"name": "Jewish Calendar",
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"Id": "string",
|
||||
"Id": "USER-UUID",
|
||||
"ViewType": "string",
|
||||
"SortBy": "string",
|
||||
"IndexBy": "string",
|
||||
|
@ -23,17 +23,6 @@ from tests.common import MockConfigEntry
|
||||
pytestmark = pytest.mark.usefixtures("mock_setup_entry")
|
||||
|
||||
|
||||
async def test_abort_if_existing_entry(hass: HomeAssistant) -> None:
|
||||
"""Check flow abort when an entry already exist."""
|
||||
MockConfigEntry(domain=DOMAIN).add_to_hass(hass)
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
assert result["reason"] == "single_instance_allowed"
|
||||
|
||||
|
||||
async def test_form(
|
||||
hass: HomeAssistant,
|
||||
mock_jellyfin: MagicMock,
|
||||
@ -201,6 +190,32 @@ async def test_form_persists_device_id_on_error(
|
||||
}
|
||||
|
||||
|
||||
async def test_already_configured(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
mock_jellyfin: MagicMock,
|
||||
mock_client: MagicMock,
|
||||
) -> None:
|
||||
"""Test the case where the user tries to configure an already configured entry."""
|
||||
|
||||
mock_config_entry.add_to_hass(hass)
|
||||
assert await hass.config_entries.async_setup(mock_config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
result = await hass.config_entries.flow.async_init(
|
||||
DOMAIN, context={"source": config_entries.SOURCE_USER}
|
||||
)
|
||||
assert result["type"] is FlowResultType.FORM
|
||||
|
||||
result = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"],
|
||||
user_input=USER_INPUT,
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
assert result["reason"] == "already_configured"
|
||||
|
||||
|
||||
async def test_reauth(
|
||||
hass: HomeAssistant,
|
||||
mock_config_entry: MockConfigEntry,
|
||||
|
Loading…
x
Reference in New Issue
Block a user