Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customise notification strings via config file #54

Open
Clon1998 opened this issue Aug 28, 2023 · 4 comments
Open

Customise notification strings via config file #54

Clon1998 opened this issue Aug 28, 2023 · 4 comments

Comments

@Clon1998
Copy link
Owner

          I can open a new issue, but since v0.4 update it appears the notifications on Android does not respect Mobileraker.conf for notifications anymore?  Did adding the new layer information and rewriting the app need the have the conf updated in some way?  As the "eta_format" section in the conf file used to be the way to customize the notifications sent by the application at % updates.

https://github.com/Clon1998/mobileraker_companion#companion---config
https://strftime.org/

Mobileraker.conf
[general]
language: en
timezone: America/Detroit
eta_format: Completed; ETA: %%I:%%M %%p
include_snapshot: False
[printer]
moonraker_uri: ws://127.0.0.1:7125/websocket
moonraker_api_key: False
snapshot_uri: http://127.0.0.1/webcam/?action=snapshot
snapshot_rotation: 0

logs-20230801-103445.zip

023-08-27 19:09:48,953 mobileraker._Default INFO - Fetched 1 app Cfgs!
2023-08-27 19:09:48,953 mobileraker._Default INFO - Evaluate for machineID f33b124e-d1ef-433a-a26a-1dddf198536f, cfg.snap: NotificationSnap(progress=20, state=printing, m117=08f1b7de713fc6929322fc9fc708b72f87b3087bc0f6a1fed393f6975a6e351f), cfg.settings: NotificationSettings(progress_config=20, state_config=['printing', 'complete', 'error'], created=2023-08-19T19:47:36.961626, last_modified=2023-08-19T19:47:36.961626)
2023-08-27 19:09:48,953 mobileraker._Default INFO - ProgressNoti preChecks: cfg.progress.config: 40 - 20 = 20 < 20 RESULT: True
2023-08-27 19:09:48,953 mobileraker._Default INFO - ProgressNoti: Print progress of Ender 6 - 40%, ETA: 19:36:41, Layer: 31/127
2023-08-27 19:09:48,953 mobileraker._Default INFO - 1 Notifications for machineID: f33b124e-d1ef-433a-a26a-1dddf198536f: state: False, proggress: True, M117 False
2023-08-27 19:09:48,953 mobileraker._Default INFO - Updating snap in FCM Cfg for f33b124e-d1ef-433a-a26a-1dddf198536f: NotificationSnap(progress=40, state=printing, m117=08f1b7de713fc6929322fc9fc708b72f87b3087bc0f6a1fed393f6975a6e351f)

Screenshot_20230827-191007_hyperion
Screenshot_20230827-192328_hyperion
Screenshot_20230828-103228_hyperion

Originally posted by @fuzelet in #50 (comment)

@Clon1998
Copy link
Owner Author

@fuzelet,
the eta_format was never intended to be used for customizing the format of the progress notification. It's sole purpose is to customize the time format of the time format for eta and adaptive eta.

I initially planned to support custom formats, but it seems like I never got around to implementing them.
As a workaround, you can temporarily modify the 18n.py file.

I am planning on making the format configurable via the config once I have got some more time :).

@fuzelet
Copy link

fuzelet commented Aug 28, 2023

Appreciate the response and guidance on this. Let me know if you need me to help test anything in the future.

@fuzelet
Copy link

fuzelet commented Sep 23, 2023

By changing
'print_progress_body': '$progress, ETA: $a_eta, Layer: $cur_layer/$max_layer',
to
'print_progress_body': '$progress, ETA: $eta, Layer: $cur_layer/$max_layer, Time Left: $remaining_avg',

it inherited what i have configured in the conf file. Any reason $a_eta was chosen over $eta? When using $remaining_avg I also only get a string of numbers outputted which seems different then what the documentation mentions I believe.

2023-09-22 19:51:48,050 mobileraker._Default INFO - ProgressNoti: Print progress of Ender 6 - 25%, ETA: 10:58 PM, Layer: 59/657, Time Left: 11220

https://github.com/Clon1998/mobileraker_companion/blob/0bb58bdda928dbdfd4074fa0bac3910b241d8ada/docs/Custom_Notifications.md

Screenshot_20230922-200133

@Clon1998
Copy link
Owner Author

Adaptive ETA should only use the timestamp (HH:MM) if the print ends on the same day, while eta always uses the format defined in the config which by default is the date and time stamp.

Regarding remaining avg, i will have a look. Seems like it only output's the seconds hence I forgot to add the formatting in the cod.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants