change search function to honor ssdp:all and the proper urn

This commit is contained in:
Emil Lerch 2019-07-24 17:44:47 -07:00
parent beda73ea3b
commit 4609c0b583
Signed by: lobo
GPG Key ID: CEC5F37C1BE5A481

View File

@ -359,7 +359,12 @@ class upnp_broadcast_responder(object):
def do_read(self, fileno):
data, sender = self.recvfrom(1024)
if data:
if data.find('M-SEARCH') == 0 and data.find('urn:Belkin:device:**') != -1:
if data.find('M-SEARCH') == 0 and (
data.find('urn:Belkin:device:**') != -1 or
data.find('ssdp:all') != -1 or
data.find('urn:Belkin:device:controllee:1') != -1
):
for device in self.devices:
time.sleep(0.1)
device.respond_to_search(sender, 'urn:Belkin:device:**')