'Update local list of devices.'

def _sync(self):

    if (not self._client.update()):
        _LOGGER.warning('Failed    request')
    def identify_device(device):
        'Find    out    what    type    of    HA    component    to    create.'
        from tellduslive import DIM, UP, TURNON
        if (device.methods & DIM):
            return 'light'
        elif (device.methods & UP):
            return 'cover'
        elif (device.methods & TURNON):
            return 'switch'
        _LOGGER.warning('Unidentified    device    type    (methods:    %d)', device.methods)
        return 'switch'
    def discover(device_id, component):
        'Discover    the    component.'
        discovery.load_platform(self._hass, component, DOMAIN, [device_id], self._config)
    known_ids = {entity.device_id for entity in self.entities}
    for device in self._client.devices:
        if (device.device_id in known_ids):
            continue
        if device.is_sensor:
            for item in device.items:
                discover((device.device_id, item.name, item.scale), 'sensor')
        else:
            discover(device.device_id, identify_device(device))
    for entity in self.entities:
        entity.changed()
