mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 20:40:18 +00:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user