Use single_instance_allowed in hassio (#128060)
* use single_instance_allowed * mark hassio as `single_config_entry`pull/128216/head
parent
8ee8421af7
commit
07021dbd65
|
@ -18,7 +18,4 @@ class HassIoConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
self, user_input: dict[str, Any] | None = None
|
||||
) -> ConfigFlowResult:
|
||||
"""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={})
|
||||
|
|
|
@ -6,5 +6,6 @@
|
|||
"documentation": "https://www.home-assistant.io/integrations/hassio",
|
||||
"iot_class": "local_polling",
|
||||
"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",
|
||||
"integration_type": "hub",
|
||||
"config_flow": false,
|
||||
"iot_class": "local_polling"
|
||||
"iot_class": "local_polling",
|
||||
"single_config_entry": true
|
||||
},
|
||||
"havana_shade": {
|
||||
"name": "Havana Shade",
|
||||
|
|
|
@ -38,4 +38,4 @@ async def test_multiple_entries(hass: HomeAssistant) -> None:
|
|||
DOMAIN, context={"source": "system"}
|
||||
)
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
assert result["reason"] == "already_configured"
|
||||
assert result["reason"] == "single_instance_allowed"
|
||||
|
|
Loading…
Reference in New Issue