async def test_webhook_handle_get_config(hass, create_registrations, webhook_client):
    'Test that we can get config properly.'
    resp = (await webhook_client.post('/api/webhook/{}'.format(create_registrations[1]['webhook_id']), json={'type': 'get_config'}))
    assert (resp.status == 200)
    json = (await resp.json())
    if ('components' in json):
        json['components'] = set(json['components'])
    if ('whitelist_external_dirs' in json):
        json['whitelist_external_dirs'] = set(json['whitelist_external_dirs'])
    hass_config = hass.config.as_dict()
    expected_dict = {'latitude': hass_config['latitude'], 'longitude': hass_config['longitude'], 'elevation': hass_config['elevation'], 'unit_system': hass_config['unit_system'], 'location_name': hass_config['location_name'], 'time_zone': hass_config['time_zone'], 'components': hass_config['components'], 'version': hass_config['version'], 'theme_color': '#03A9F4'}
    assert (expected_dict == json)
Test that we can get config properly.
async def test_webhook_handle_get_config(hass, create_registrations, webhook_client):
    
    resp = (await webhook_client.post('/api/webhook/{}'.format(create_registrations[1]['webhook_id']), json={'type': 'get_config'}))
    assert (resp.status == 200)
    json = (await resp.json())
    if ('components' in json):
        json['components'] = set(json['components'])
    if ('whitelist_external_dirs' in json):
        json['whitelist_external_dirs'] = set(json['whitelist_external_dirs'])
    hass_config = hass.config.as_dict()
    expected_dict = {'latitude': hass_config['latitude'], 'longitude': hass_config['longitude'], 'elevation': hass_config['elevation'], 'unit_system': hass_config['unit_system'], 'location_name': hass_config['location_name'], 'time_zone': hass_config['time_zone'], 'components': hass_config['components'], 'version': hass_config['version'], 'theme_color': '#03A9F4'}
    assert (expected_dict == json)