mirror of
https://github.com/home-assistant/core.git
synced 2025-11-10 11:29:46 +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:
@@ -10,6 +10,8 @@ from homeassistant.components.homekit.const import (
|
||||
FEATURE_ON_OFF,
|
||||
FEATURE_PLAY_PAUSE,
|
||||
HOMEKIT_NOTIFY_ID,
|
||||
HOMEKIT_PAIRING_QR,
|
||||
HOMEKIT_PAIRING_QR_SECRET,
|
||||
TYPE_FAUCET,
|
||||
TYPE_OUTLET,
|
||||
TYPE_SHOWER,
|
||||
@@ -199,8 +201,10 @@ async def test_show_setup_msg(hass):
|
||||
|
||||
call_create_notification = async_mock_service(hass, DOMAIN, "create")
|
||||
|
||||
await hass.async_add_executor_job(show_setup_message, hass, pincode)
|
||||
await hass.async_add_executor_job(show_setup_message, hass, pincode, "X-HM://0")
|
||||
await hass.async_block_till_done()
|
||||
assert hass.data[HOMEKIT_PAIRING_QR_SECRET]
|
||||
assert hass.data[HOMEKIT_PAIRING_QR]
|
||||
|
||||
assert call_create_notification
|
||||
assert call_create_notification[0].data[ATTR_NOTIFICATION_ID] == HOMEKIT_NOTIFY_ID
|
||||
|
||||
Reference in New Issue
Block a user