From b46be5f24298b47640b366765d549d5878dc13d3 Mon Sep 17 00:00:00 2001 From: Patrick Schmidt Date: Tue, 16 Jul 2024 11:46:04 +0200 Subject: [PATCH] feat: Add support for ETA sources in notification settings --- mobileraker/data/dtos/mobileraker/notification_config_dto.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mobileraker/data/dtos/mobileraker/notification_config_dto.py b/mobileraker/data/dtos/mobileraker/notification_config_dto.py index 92f9f57..c34e227 100644 --- a/mobileraker/data/dtos/mobileraker/notification_config_dto.py +++ b/mobileraker/data/dtos/mobileraker/notification_config_dto.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Optional, Set # "5f4d11e8-ad41-4126-88ff-7593b68555d9": { # "created": "2022-11-25T23:03:47.656260", @@ -108,6 +108,7 @@ def __init__(self): self.progress_config: int = 25 self.state_config: List[str] = [] self.android_progressbar: bool = True + self.eta_sources: List[str] = ['filament','slicer'] @staticmethod def fromJSON(json: Dict[str, Any]) -> 'NotificationSettings': @@ -120,6 +121,7 @@ def fromJSON(json: Dict[str, Any]) -> 'NotificationSettings': 50, round(prog_float * 100)) if prog_float > 0 else -1 cfg.state_config = json['states'] cfg.android_progressbar = json['android_progressbar'] if 'android_progressbar' in json else True + cfg.eta_sources = json['eta_sources'] if 'eta_sources' in json else [] return cfg