mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Don't allow more than one config flow per discovered Axis device (#24230)
This commit is contained in:
parent
0ba2b4e253
commit
f43eca248a
@ -155,6 +155,13 @@ class AxisFlowHandler(config_entries.ConfigFlow):
|
|||||||
return self.async_abort(reason='link_local_address')
|
return self.async_abort(reason='link_local_address')
|
||||||
|
|
||||||
serialnumber = discovery_info['properties']['macaddress']
|
serialnumber = discovery_info['properties']['macaddress']
|
||||||
|
# pylint: disable=unsupported-assignment-operation
|
||||||
|
self.context['macaddress'] = serialnumber
|
||||||
|
|
||||||
|
if any(serialnumber == flow['context']['macaddress']
|
||||||
|
for flow in self._async_in_progress()):
|
||||||
|
return self.async_abort(reason='already_in_progress')
|
||||||
|
|
||||||
device_entries = configured_devices(self.hass)
|
device_entries = configured_devices(self.hass)
|
||||||
|
|
||||||
if serialnumber in device_entries:
|
if serialnumber in device_entries:
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
},
|
},
|
||||||
"error": {
|
"error": {
|
||||||
"already_configured": "Device is already configured",
|
"already_configured": "Device is already configured",
|
||||||
|
"already_in_progress": "Config flow for device is already in progress.",
|
||||||
"device_unavailable": "Device is not available",
|
"device_unavailable": "Device is not available",
|
||||||
"faulty_credentials": "Bad user credentials"
|
"faulty_credentials": "Bad user credentials"
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user