-
-
Notifications
You must be signed in to change notification settings - Fork 954
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
settings: Add sleep/wake notification times #2002
base: main
Are you sure you want to change the base?
Conversation
Build size and comparison to main:
|
Hi and thanks for your first contribution to the InfiniTime project ! Oh and also do not forget to check that those changes are consistent with the InfiniTime vision. |
I think this is similar to #1461, right? I think this is a very useful feature, let's decide on a good implementation together. It might be good if you could upload pictures from InfiniSim to see the UI. |
@FintasticMan yes, it's exactly like that, I didn't see it before. Here are a couple screenshots: (I noticed I forgot to change "current time" in my code, until I looked closer to get the screenshot). Setting sleep and wake times to the same value disables the operation. |
const int hoursValue = hourCounter.GetValue(); | ||
const int minutesValue = minuteCounter.GetValue(); | ||
NRF_LOG_INFO("Setting wakeup time to %02d:%02d:00", hoursValue, minutesValue); | ||
settingsController.SetSleepTime(static_cast<uint8_t>(hoursValue), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is setting the sleep time instead of the wake time.
NRF_LOG_INFO("Setting sleep time to %02d:%02d:00", hoursValue, minutesValue); | ||
settingsController.SetSleepTime(static_cast<uint8_t>(hoursValue), | ||
static_cast<uint8_t>(minutesValue)); | ||
settingSetSleepWakeTime.Quit(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make pressing the "set" button advance to the set wake time screen (like what happens with the set date & time setting).
settingSetSleepWakeTime.Quit(); | |
settingSetSleepWakeTime.Advance(); |
uint8_t h, m; | ||
|
||
lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr); | ||
lv_label_set_text_static(title, "Set current time"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you said you changed this? maybe you forgot to push the change?
lv_label_set_text_static(title, "Set current time"); | |
lv_label_set_text_static(title, "Set wake time"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must've only changed it in my InfiniSim checkout, which seems to have vanished for me, too. Will update, along with all your suggestions.
I have been testing this pr (with my suggestions above) for the past few days, and for some reason, sleep mode only automatically starts if the notification settings is set to ring (and not do not disturb). I don't see any code that does that, so I think its a weird bug? |
It's intentional. SetNotificationStatusByTime() first checks if the notification status is "Off" (looks like DnD to me), and if so it doesn't change it. The idea being that you would explicitly set/unset DnD, and the watch changing it itself would be a surprise, and go against your desire to not be disturbed. |
Add configure screens for sleep and wake notification times, so the watch can automatically set notifications to sleep or on as applicable.
Add configure screens for sleep and wake notification times, so the watch can automatically set notifications to sleep or on as applicable.
This could probably be done in a much better way, but I didn't want to refactor the whole date/time UI to add this. An alternative, doing that, is to create a widget base class for all time-like setting widgets, and derive from that for each of the various interfaces.