def __init__(self, device): log.Loggable.__init__(self) self.device = device self.device_type = self.device.get_friendly_device_type() self.version = int(self.device.get_device_type_version()) self.icons = device.icons self.wan_ip_connection = None self.wan_ppp_connection = None self.detection_completed = False louie.connect(self.service_notified, signal='Coherence.UPnP.DeviceClient.Service.notified', sender=self.device) for service in self.device.get_services(): if service.get_type() in [ "urn:schemas-upnp-org:service:WANIPConnection:1" ]: self.wan_ip_connection = WANIPConnectionClient(service) if service.get_type() in [ "urn:schemas-upnp-org:service:WANPPPConnection:1" ]: self.wan_ppp_connection = WANPPPConnectionClient(service) self.info("WANConnectionDevice %s", self.device.get_friendly_name()) if self.wan_ip_connection: self.info("WANIPConnection service available") if self.wan_ppp_connection: self.info("WANPPPConnection service available")
def __init__(self, device): log.LogAble.__init__(self) EventDispatcher.__init__(self) self.register_event('embedded_device_client_detection_completed') self.device = device self.device.bind(service_notified=self.service_notified) self.device_type = self.device.get_friendly_device_type() self.version = int(self.device.get_device_type_version()) self.icons = device.icons self.wan_ip_connection = None self.wan_ppp_connection = None for service in self.device.get_services(): if service.get_type() in [ 'urn:schemas-upnp-org:service:WANIPConnection:1' ]: self.wan_ip_connection = WANIPConnectionClient(service) if service.get_type() in [ 'urn:schemas-upnp-org:service:WANPPPConnection:1' ]: self.wan_ppp_connection = WANPPPConnectionClient(service) self.info(f'WANConnectionDevice {device.get_friendly_name()}') if self.wan_ip_connection: self.info('WANIPConnection service available') if self.wan_ppp_connection: self.info('WANPPPConnection service available')