Esempio n. 1
0
def test_create_philips_hue_component():
    device = {
        'id': 'ph1',
        'type': 'philips_hue',
        'name': 'Philips Hue Bridge 1',
        'ip': '127.0.0.1',
        'extra': {
            'username': '******',
            'lights': {
                '4': {},
                '5': {},
                '6': {},
                '7': {},
                '8': {},
            }
        }
    }
    component = create_component(device)
    assert component == {
        'id': component['id'],
        'device_ids': ['ph1-light-4', 'ph1-light-5', 'ph1-light-6', 'ph1-light-7', 'ph1-light-8'],
        'type': 'philips_hue',
        'name': 'Philips Hue Bridge 1',
        'ip_address': '127.0.0.1',
        'username': '******',
    }
Esempio n. 2
0
def test_create_soundtouch_component():
    device = {
        'id': 'soundtouch1',
        'type': 'soundtouch',
        'ha_entity_id': 'media_player.bose_soundtouch',
    }
    component = create_component(device)
    assert component == {
        'id': component['id'],
        'device_ids': ['soundtouch1'],
        'type': 'media_player',
        'ha_entity_id': 'media_player.bose_soundtouch',
    }
Esempio n. 3
0
def test_create_sonos_component():
    device = {
        'id': 'sonos1',
        'type': 'sonos',
        'name': 'test sonos',
        'ip': '127.0.0.1',
        'extra': {}
    }
    component = create_component(device)
    assert component == {
        'id': component['id'],
        'device_ids': ['sonos1'],
        'type': 'sonos',
        'name': 'test sonos',
        'ip_address': '127.0.0.1',
    }