Add a notify function to send one notification.

main
KKlochko 1 year ago
parent d536d7cb34
commit 6d15e2ad29

@ -73,3 +73,15 @@ class ProducerClient:
self.writer.close() self.writer.close()
await self.writer.wait_closed() await self.writer.wait_closed()
async def notify(self, title, message):
await self.connect()
try:
await self.send_notification(title, message)
await self.send_notification('', '')
except asyncio.CancelledError:
pass
finally:
self.writer.close()
await self.writer.wait_closed()

Loading…
Cancel
Save