@patch('homeassistant.helpers.entity_platform.async_track_time_interval')
def test_set_scan_interval_via_config(self, mock_track):
    'Test the setting of the scan interval via configuration.'

    def platform_setup(hass, config, add_entities, discovery_info=None):
        'Test the platform setup.'
        add_entities([MockEntity(should_poll=True)])
    mock_entity_platform(self.hass, 'test_domain.platform', MockPlatform(platform_setup))
    component = EntityComponent(_LOGGER, DOMAIN, self.hass)
    component.setup({DOMAIN: {'platform': 'platform', 'scan_interval': timedelta(seconds=30)}})
    self.hass.block_till_done()
    assert mock_track.called
    assert (timedelta(seconds=30) == mock_track.call_args[0][2])
Test the setting of the scan interval via configuration.
@patch('homeassistant.helpers.entity_platform.async_track_time_interval')
def test_set_scan_interval_via_config(self, mock_track):
    

    def platform_setup(hass, config, add_entities, discovery_info=None):
        'Test the platform setup.'
        add_entities([MockEntity(should_poll=True)])
    mock_entity_platform(self.hass, 'test_domain.platform', MockPlatform(platform_setup))
    component = EntityComponent(_LOGGER, DOMAIN, self.hass)
    component.setup({DOMAIN: {'platform': 'platform', 'scan_interval': timedelta(seconds=30)}})
    self.hass.block_till_done()
    assert mock_track.called
    assert (timedelta(seconds=30) == mock_track.call_args[0][2])