Add upload/download of sud.json over the Sud websocket channel

Sud.download() returns the on-disk document; Sud.upload() validates,
persists, and resets the schedule, refusing mid-brew or malformed input
so the current schedule is never left half-applied.
This commit is contained in:
2026-06-20 22:14:27 +02:00
parent 6fb85415eb
commit db57f3305c
3 changed files with 99 additions and 8 deletions
+5
View File
@@ -69,6 +69,11 @@ class SudTask(ATask):
self.sud.start()
elif 'Confirm' in pair[0]:
self.sud.confirm()
elif 'Download' in pair[0]:
await self.send({'Json': self.sud.download()})
elif 'Upload' in pair[0]:
if self.sud.upload(pair[1]):
await self.send({'Name': self.sud.name, 'Description': self.sud.description})
async def send(self, data):
await self.msg_handler.send(data)