Ejemplo n.º 1
0
    def check_device(self, device):
        if device.client == None:
            self.info("found device %s of type %s - %r" %
                      (device.get_friendly_name(), device.get_device_type(),
                       device.client))
            short_type = device.get_friendly_device_type()
            if short_type in self.auto_client and short_type is not None:
                self.info("identified %s %r" %
                          (short_type, device.get_friendly_name()))

                if short_type == 'MediaServer':
                    client = MediaServerClient(device)
                if short_type == 'MediaRenderer':
                    client = MediaRendererClient(device)
                if short_type == 'BinaryLight':
                    client = BinaryLightClient(device)
                if short_type == 'DimmableLight':
                    client = DimmableLightClient(device)
                if short_type == 'InternetGatewayDevice':
                    client = InternetGatewayDeviceClient(device)

                client.coherence = self.coherence
                device.set_client(client)

        self.process_queries(device)
Ejemplo n.º 2
0
    def check_device(self, device):
        if device.client is None:
            self.info("found device %s of type %s - %r", device.get_friendly_name(),
                                                device.get_device_type(), device.client)
            short_type = device.get_friendly_device_type()
            if short_type in self.auto_client and short_type is not None:
                self.info("identified %s %r", short_type, device.get_friendly_name())

                if short_type == 'MediaServer':
                    client = MediaServerClient(device)
                if short_type == 'MediaRenderer':
                    client = MediaRendererClient(device)
                if short_type == 'InternetGatewayDevice':
                    client = InternetGatewayDeviceClient(device)

                client.coherence = self.coherence
                device.set_client(client)

        self.process_queries(device)
Ejemplo n.º 3
0
def check_device(device):
    print "found device %s of type %s - %r" % (
        device.get_friendly_name(), device.get_device_type(), device.client)
    return
    if (device.get_device_type() == 'urn:schemas-upnp-org:device:MediaServer:1'
        ):
        client = MediaServerClient(device)

        d = client.content_directory.browse(0,
                                            browse_flag='BrowseDirectChildren',
                                            process_result=False,
                                            backward_compatibility=False)
        d.addCallback(process_media_server_browse, client)
Ejemplo n.º 4
0
    def check_device( self, device):
        if device.client == None:
            self.info("found device %s of type %s - %r" %(device.get_friendly_name(),
                                                device.get_device_type(), device.client))
            short_type = device.get_friendly_device_type()
            if short_type in self.auto_client and short_type is not None:
                self.info("identified %s %r" %
                        (short_type, device.get_friendly_name()))

                if short_type == 'MediaServer':
                    client = MediaServerClient(device)
                if short_type == 'MediaRenderer':
                    client = MediaRendererClient(device)
                if short_type == 'BinaryLight':
                    client = BinaryLightClient(device)
                if short_type == 'DimmableLight':
                    client = DimmableLightClient(device)

                client.coherence = self.coherence
                device.set_client( client)

        self.process_queries(device)
Ejemplo n.º 5
0
    def check_device(self, device):
        if device.client is None:
            self.info(f'found device {device.get_friendly_name()} of type '
                      f'{device.get_device_type()} - {device.client}')
            short_type = device.get_friendly_device_type()
            if short_type in self.auto_client and short_type is not None:
                self.info(
                    f'identified {short_type} {device.get_friendly_name()}')

                if short_type == 'MediaServer':
                    client = MediaServerClient(device)
                if short_type == 'MediaRenderer':
                    client = MediaRendererClient(device)
                if short_type == 'InternetGatewayDevice':
                    client = InternetGatewayDeviceClient(device)
                client.bind(detection_completed=self.completed)
                client.coherence = self.coherence

                device.set_client(client)

        if device.client.detection_completed:
            self.completed(device.client)
        self.process_queries(device)
Ejemplo n.º 6
0
 def check_device(self, device):
     if device.client == None:
         short_type = device.get_friendly_device_type()
         friendly_name = device.get_friendly_name()
         self.info("found device %s of type %s - %r" % (friendly_name, device.get_device_type(), device.client))
         #print("control_point.check_device() found Device:{0:}, Type:{1:}, Client:{2:}, Type:{3:}".format(friendly_name, device.get_device_type(), device.client, short_type))
         if short_type in self.auto_client and short_type is not None:
             self.info("identified %s %r" % (short_type, friendly_name))
             #print("control_point.check_device() identified %s %r" % (short_type, friendly_name))
             if short_type == 'MediaServer':
                 client = MediaServerClient(device)
             if short_type == 'MediaRenderer':
                 client = MediaRendererClient(device)
             if short_type == 'BinaryLight':
                 client = BinaryLightClient(device)
             if short_type == 'DimmableLight':
                 client = DimmableLightClient(device)
             if short_type == 'InternetGatewayDevice':
                 client = InternetGatewayDeviceClient(device)
             client.coherence = self.coherence
             device.set_client(client)
     self.process_queries(device)