Add a notify function to send one notification.
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user