ssdpy
ssdpy copied to clipboard
There is no `notify()` method in SSDPServer
The README contains this example to send a NOTIFY message:
>>> from ssdpy import SSDPServer
>>> server = SSDPServer("my-service-identifier")
>>> server.notify()
But there doesn’t seem to be any notify() method, so I added this to the “server.py” file for now:
def notify(self):
data = create_notify_payload(host=self._broadcast_ip,
nt=self.device_type,
usn=self.usn
max_age=self.max_age,
)
self.sock.sendto(data, self._address)
I haven’t done a pull request yet as I guess this function lacks some value checks, some parameters and maybe other things. Maybe I’ll try to make it safer later if noone does it before me. 🙂