Adhere to scan_interval in platforms when setup via config entry (#14969)
This commit is contained in:
parent
d6d685a483
commit
1128104281
3 changed files with 11 additions and 3 deletions
|
@ -346,7 +346,8 @@ async def test_setup_entry(hass):
|
|||
mock_setup_entry = Mock(return_value=mock_coro(True))
|
||||
loader.set_component(
|
||||
hass, 'test_domain.entry_domain',
|
||||
MockPlatform(async_setup_entry=mock_setup_entry))
|
||||
MockPlatform(async_setup_entry=mock_setup_entry,
|
||||
scan_interval=timedelta(seconds=5)))
|
||||
|
||||
component = EntityComponent(_LOGGER, DOMAIN, hass)
|
||||
entry = MockConfigEntry(domain='entry_domain')
|
||||
|
@ -357,6 +358,9 @@ async def test_setup_entry(hass):
|
|||
assert p_hass is hass
|
||||
assert p_entry is entry
|
||||
|
||||
assert component._platforms[entry.entry_id].scan_interval == \
|
||||
timedelta(seconds=5)
|
||||
|
||||
|
||||
async def test_setup_entry_platform_not_exist(hass):
|
||||
"""Test setup entry fails if platform doesnt exist."""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue