Display Homekit QR code when pairing (#34449)
* Display a QR code for homekit pairing This will reduce the failure rate with HomeKit pairing because there is less chance of entry error. * Add coverage * Test that the qr code is created * I cannot spell * Update homeassistant/components/homekit/__init__.py Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io> * Update homeassistant/components/homekit/__init__.py Co-Authored-By: Paulus Schoutsen <paulus@home-assistant.io> Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
This commit is contained in:
parent
ca08b70984
commit
d06fce6997
10 changed files with 75 additions and 14 deletions
|
@ -340,6 +340,8 @@ def test_home_driver():
|
|||
|
||||
mock_driver.assert_called_with(address=ip_address, port=port, persist_file=path)
|
||||
driver.state = Mock(pincode=pin)
|
||||
xhm_uri_mock = Mock(return_value="X-HM://0")
|
||||
driver.accessory = Mock(xhm_uri=xhm_uri_mock)
|
||||
|
||||
# pair
|
||||
with patch("pyhap.accessory_driver.AccessoryDriver.pair") as mock_pair, patch(
|
||||
|
@ -357,4 +359,4 @@ def test_home_driver():
|
|||
driver.unpair("client_uuid")
|
||||
|
||||
mock_unpair.assert_called_with("client_uuid")
|
||||
mock_show_msg.assert_called_with("hass", pin)
|
||||
mock_show_msg.assert_called_with("hass", pin, "X-HM://0")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue