def __init__(self, host): Logr.configure(logging.DEBUG) self.host = host self.device = TmServerDevice(host) self.upnp = UPnP(self.device) self.ssdp = SSDP(self.device, [host], host)
except EOFError: self.command_stop() def command_stop(self): # Send 'byebye' NOTIFY self.ssdp.clients.sendall_NOTIFY(None, 'ssdp:byebye', True) # Stop everything self.upnp.stop() self.ssdp.stop() reactor.stop() self.running = False if __name__ == '__main__': Logr.configure(logging.DEBUG) device = MediaServerDevice() upnp = UPnP(device) ssdp = SSDP(device) upnp.listen() ssdp.listen() def event_test(): # device.contentDirectory.system_update_id = time.time() reactor.callLater(5, event_test) event_test()
getattr(self, command)() except EOFError: self.command_stop() def command_stop(self): # Send 'byebye' NOTIFY self.ssdp.clients.sendall_NOTIFY(None, 'ssdp:byebye', True) # Stop everything self.upnp.stop() self.ssdp.stop() reactor.stop() self.running = False if __name__ == '__main__': Logr.configure(logging.DEBUG) device = MediaServerDevice() upnp = UPnP(device) ssdp = SSDP(device) upnp.listen() ssdp.listen() def event_test(): device.contentDirectory.system_update_id = time.time() reactor.callLater(5, event_test) event_test()