mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Improve improv via BLE log messages (#135575)
This commit is contained in:
parent
09e2168f72
commit
440cd5bee0
@ -126,15 +126,23 @@ class ImprovBLEConfigFlow(ConfigFlow, domain=DOMAIN):
|
||||
)
|
||||
except improv_ble_errors.InvalidCommand as err:
|
||||
_LOGGER.warning(
|
||||
"Aborting improv flow, device %s sent invalid improv data: '%s'",
|
||||
self._discovery_info.address,
|
||||
(
|
||||
"Received invalid improv via BLE data '%s' from device with "
|
||||
"bluetooth address '%s'; if the device is a self-configured "
|
||||
"ESPHome device, either correct or disable the 'esp32_improv' "
|
||||
"configuration; if it's a commercial device, contact the vendor"
|
||||
),
|
||||
service_data[SERVICE_DATA_UUID].hex(),
|
||||
self._discovery_info.address,
|
||||
)
|
||||
raise AbortFlow("invalid_improv_data") from err
|
||||
|
||||
if improv_service_data.state in (State.PROVISIONING, State.PROVISIONED):
|
||||
_LOGGER.debug(
|
||||
"Aborting improv flow, device %s is already provisioned: %s",
|
||||
(
|
||||
"Aborting improv flow, device with bluetooth address '%s' is "
|
||||
"already provisioned: %s"
|
||||
),
|
||||
self._discovery_info.address,
|
||||
improv_service_data.state,
|
||||
)
|
||||
|
@ -664,6 +664,6 @@ async def test_provision_fails_invalid_data(
|
||||
assert result["type"] is FlowResultType.ABORT
|
||||
assert result["reason"] == "invalid_improv_data"
|
||||
assert (
|
||||
"Aborting improv flow, device AA:BB:CC:DD:EE:F0 sent invalid improv data: '000000000000'"
|
||||
"Received invalid improv via BLE data '000000000000' from device with bluetooth address 'AA:BB:CC:DD:EE:F0'"
|
||||
in caplog.text
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user