def _get_setup(self, result):
        """Internal method which process the results from the server."""
        self.__devices = {}

        if ('setup' not in result.keys() or
                'devices' not in result['setup'].keys()):
            raise Exception(
                "Did not find device definition.")

        for device_data in result['setup']['devices']:
            device = Device(self, device_data)
            self.__devices[device.url] = device

        self.__location = result['setup']['location']
        self.__gateway = result['setup']['gateways']
Internal method which process the results from the server.