Use addon uuid as wyoming config entry unique id (#92008)

pull/92025/head
Erik Montnemery 2023-04-25 21:04:11 +02:00 committed by GitHub
parent 74e3cac8b5
commit 64cbc91697
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -65,7 +65,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
async def async_step_hassio(self, discovery_info: HassioServiceInfo) -> FlowResult:
"""Handle Supervisor add-on discovery."""
await self.async_set_unique_id(discovery_info.slug)
await self.async_set_unique_id(discovery_info.uuid)
self._abort_if_unique_id_configured()
self._hassio_discovery = discovery_info

View File

@ -3,7 +3,7 @@
FlowResultSnapshot({
'context': dict({
'source': 'hassio',
'unique_id': 'mock_piper',
'unique_id': '1234',
}),
'data': dict({
'host': 'mock-piper',
@ -29,7 +29,7 @@
'pref_disable_polling': False,
'source': 'hassio',
'title': 'Piper',
'unique_id': 'mock_piper',
'unique_id': '1234',
'version': 1,
}),
'title': 'Piper',

View File

@ -165,7 +165,7 @@ async def test_hassio_addon_already_configured(hass: HomeAssistant) -> None:
MockConfigEntry(
domain=DOMAIN,
data={"host": "mock-piper", "port": "10200"},
unique_id="mock_piper",
unique_id="1234",
).add_to_hass(hass)
result = await hass.config_entries.flow.async_init(