mirror of
https://github.com/home-assistant/core.git
synced 2025-07-24 21:57:51 +00:00
Migrate smartthings to use async_update_entry to alter config entries (#110403)
This commit is contained in:
parent
db9c08b2e0
commit
c3d9192384
@ -32,8 +32,8 @@ async def test_migration_creates_new_flow(
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Test migration deletes app and creates new flow."""
|
"""Test migration deletes app and creates new flow."""
|
||||||
|
|
||||||
config_entry.version = 1
|
|
||||||
config_entry.add_to_hass(hass)
|
config_entry.add_to_hass(hass)
|
||||||
|
hass.config_entries.async_update_entry(config_entry, version=1)
|
||||||
|
|
||||||
await smartthings.async_migrate_entry(hass, config_entry)
|
await smartthings.async_migrate_entry(hass, config_entry)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
@ -409,6 +409,7 @@ async def test_broker_regenerates_token(hass: HomeAssistant, config_entry) -> No
|
|||||||
token = Mock(OAuthToken)
|
token = Mock(OAuthToken)
|
||||||
token.refresh_token = str(uuid4())
|
token.refresh_token = str(uuid4())
|
||||||
stored_action = None
|
stored_action = None
|
||||||
|
config_entry.add_to_hass(hass)
|
||||||
|
|
||||||
def async_track_time_interval(hass, action, interval):
|
def async_track_time_interval(hass, action, interval):
|
||||||
nonlocal stored_action
|
nonlocal stored_action
|
||||||
@ -455,10 +456,14 @@ async def test_event_handler_dispatches_updated_devices(
|
|||||||
data={"codeId": "1"},
|
data={"codeId": "1"},
|
||||||
)
|
)
|
||||||
request = event_request_factory(device_ids=device_ids, events=[event])
|
request = event_request_factory(device_ids=device_ids, events=[event])
|
||||||
config_entry.data = {
|
config_entry.add_to_hass(hass)
|
||||||
**config_entry.data,
|
hass.config_entries.async_update_entry(
|
||||||
CONF_INSTALLED_APP_ID: request.installed_app_id,
|
config_entry,
|
||||||
}
|
data={
|
||||||
|
**config_entry.data,
|
||||||
|
CONF_INSTALLED_APP_ID: request.installed_app_id,
|
||||||
|
},
|
||||||
|
)
|
||||||
called = False
|
called = False
|
||||||
|
|
||||||
def signal(ids):
|
def signal(ids):
|
||||||
@ -520,10 +525,14 @@ async def test_event_handler_fires_button_events(
|
|||||||
device.device_id, capability="button", attribute="button", value="pushed"
|
device.device_id, capability="button", attribute="button", value="pushed"
|
||||||
)
|
)
|
||||||
request = event_request_factory(events=[event])
|
request = event_request_factory(events=[event])
|
||||||
config_entry.data = {
|
config_entry.add_to_hass(hass)
|
||||||
**config_entry.data,
|
hass.config_entries.async_update_entry(
|
||||||
CONF_INSTALLED_APP_ID: request.installed_app_id,
|
config_entry,
|
||||||
}
|
data={
|
||||||
|
**config_entry.data,
|
||||||
|
CONF_INSTALLED_APP_ID: request.installed_app_id,
|
||||||
|
},
|
||||||
|
)
|
||||||
called = False
|
called = False
|
||||||
|
|
||||||
def handler(evt):
|
def handler(evt):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user