mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 16:57:10 +00:00
Use single_instance_allowed in hassio (#128060)
* use single_instance_allowed * mark hassio as `single_config_entry`
This commit is contained in:
parent
8ee8421af7
commit
07021dbd65
@ -18,7 +18,4 @@ class HassIoConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||||||
self, user_input: dict[str, Any] | None = None
|
self, user_input: dict[str, Any] | None = None
|
||||||
) -> ConfigFlowResult:
|
) -> ConfigFlowResult:
|
||||||
"""Handle the initial step."""
|
"""Handle the initial step."""
|
||||||
# We only need one Hass.io config entry
|
|
||||||
await self.async_set_unique_id(DOMAIN)
|
|
||||||
self._abort_if_unique_id_configured()
|
|
||||||
return self.async_create_entry(title="Supervisor", data={})
|
return self.async_create_entry(title="Supervisor", data={})
|
||||||
|
@ -6,5 +6,6 @@
|
|||||||
"documentation": "https://www.home-assistant.io/integrations/hassio",
|
"documentation": "https://www.home-assistant.io/integrations/hassio",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"quality_scale": "internal",
|
"quality_scale": "internal",
|
||||||
"requirements": ["aiohasupervisor==0.2.0b0"]
|
"requirements": ["aiohasupervisor==0.2.0b0"],
|
||||||
|
"single_config_entry": true
|
||||||
}
|
}
|
||||||
|
@ -2470,7 +2470,8 @@
|
|||||||
"name": "Home Assistant Supervisor",
|
"name": "Home Assistant Supervisor",
|
||||||
"integration_type": "hub",
|
"integration_type": "hub",
|
||||||
"config_flow": false,
|
"config_flow": false,
|
||||||
"iot_class": "local_polling"
|
"iot_class": "local_polling",
|
||||||
|
"single_config_entry": true
|
||||||
},
|
},
|
||||||
"havana_shade": {
|
"havana_shade": {
|
||||||
"name": "Havana Shade",
|
"name": "Havana Shade",
|
||||||
|
@ -38,4 +38,4 @@ async def test_multiple_entries(hass: HomeAssistant) -> None:
|
|||||||
DOMAIN, context={"source": "system"}
|
DOMAIN, context={"source": "system"}
|
||||||
)
|
)
|
||||||
assert result["type"] is FlowResultType.ABORT
|
assert result["type"] is FlowResultType.ABORT
|
||||||
assert result["reason"] == "already_configured"
|
assert result["reason"] == "single_instance_allowed"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user