mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 17:27:52 +00:00
Fix homekit migration not being awaited (#46460)
This commit is contained in:
parent
dd8d4471ec
commit
bc8a52038b
@ -240,7 +240,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry):
|
||||
|
||||
if CONF_ENTRY_INDEX in conf and conf[CONF_ENTRY_INDEX] == 0:
|
||||
_LOGGER.debug("Migrating legacy HomeKit data for %s", name)
|
||||
hass.async_add_executor_job(
|
||||
await hass.async_add_executor_job(
|
||||
migrate_filesystem_state_data_for_primary_imported_entry_id,
|
||||
hass,
|
||||
entry.entry_id,
|
||||
|
@ -51,7 +51,7 @@ from homeassistant.const import (
|
||||
CONF_PORT,
|
||||
DEVICE_CLASS_BATTERY,
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
EVENT_HOMEASSISTANT_START,
|
||||
EVENT_HOMEASSISTANT_STARTED,
|
||||
EVENT_HOMEASSISTANT_STOP,
|
||||
PERCENTAGE,
|
||||
SERVICE_RELOAD,
|
||||
@ -118,7 +118,7 @@ async def test_setup_min(hass, mock_zeroconf):
|
||||
|
||||
# Test auto start enabled
|
||||
mock_homekit.reset_mock()
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_START)
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_STARTED)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
mock_homekit().async_start.assert_called()
|
||||
@ -155,7 +155,7 @@ async def test_setup_auto_start_disabled(hass, mock_zeroconf):
|
||||
# Test auto_start disabled
|
||||
homekit.reset_mock()
|
||||
homekit.async_start.reset_mock()
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_START)
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_STARTED)
|
||||
await hass.async_block_till_done()
|
||||
assert homekit.async_start.called is False
|
||||
|
||||
@ -951,7 +951,7 @@ async def test_setup_imported(hass, mock_zeroconf):
|
||||
|
||||
# Test auto start enabled
|
||||
mock_homekit.reset_mock()
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_START)
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_STARTED)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
mock_homekit().async_start.assert_called()
|
||||
@ -1005,7 +1005,7 @@ async def test_yaml_updates_update_config_entry_for_name(hass, mock_zeroconf):
|
||||
|
||||
# Test auto start enabled
|
||||
mock_homekit.reset_mock()
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_START)
|
||||
hass.bus.async_fire(EVENT_HOMEASSISTANT_STARTED)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
mock_homekit().async_start.assert_called()
|
||||
|
Loading…
x
Reference in New Issue
Block a user