From 67c98f6a7610ff4196954a665e5599bea9ccf5ac Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Wed, 7 Feb 2024 10:55:41 -0500 Subject: [PATCH] announcements: push notification for internal announcements Signed-off-by: Eric Callahan --- moonraker/components/announcements.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/moonraker/components/announcements.py b/moonraker/components/announcements.py index 763197e..55c223e 100644 --- a/moonraker/components/announcements.py +++ b/moonraker/components/announcements.py @@ -236,8 +236,15 @@ class Announcements: "feed": feed } self.entry_mgr.add_entry(entry) + self.eventloop.create_task(self._notify_internal()) return entry + async def _notify_internal(self) -> None: + entries = await self.entry_mgr.list_entries() + self.server.send_event( + "announcements:entries_updated", {"entries": entries} + ) + async def remove_announcement(self, entry_id: str) -> None: ret = await self.entry_mgr.remove_entry(entry_id) if ret is not None: