-
Notifications
You must be signed in to change notification settings - Fork 16
Add config option to vibrate on every full hour #74
Conversation
@rezart thanks for this. The code looks pretty good but there's a few changes I would like to make before merging it. Would you have some time to update your PR if I give some comments? |
@@ -282,6 +290,10 @@ static void config_weather_enabled_updated(DictionaryIterator * iter, Tuple * tu | |||
update_info_layer(); | |||
} | |||
|
|||
static void config_hourly_vibrate_updated(DictionaryIterator * iter, Tuple * tuple){ | |||
config_set_int(s_config, ConfigKeyVibrateOnTheHour, tuple->value->int8); |
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 should use config_set_bool
.
@groyoh updated :) let me know if you have any other pieces of feedback. |
if(hour > 12){ | ||
hour -= 12; | ||
}else if(hour == 0){ | ||
hour = 12; | ||
} | ||
|
||
if(should_vibrate_on_the_hour && minutes == 0){ | ||
vibes_short_pulse(); |
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.
It would be better to move this in the tick_handler
function. Something like:
static void tick_handler(struct tm *tick_time, TimeUnits units_changed){
+ if(units_changed & HOUR_UNIT){
+ bool vibrate_on_the_hour = config_get_bool(s_config, ConfigKeyVibrateOnTheHour);
+ if(vibrate_on_the_hour){
+ vibes_short_pulse();
+ }
+ }
schedule_weather_request(10000);
That way we also avoid calling the config if the hour didn't change.
@rezart do you (plan to) use this feature on a daily basis? How does it go when you sleep with your watch? Doesn't it bother you? @AlessioLaiso and I were thinking about disabling the feature when the user sleeps (e.g. using the |
@groyoh yes I have been using this since last night. That is a good point about the vibrations during quiet times. I actually thought of that right before heading to bed last night and thought it would be annoying, but surprisingly I did not feel any vibrations while sleeping. At first I thought maybe this is something the underlying OS controls directly, where once quiet time is enabled all vibrations are disabled automatically... Could of also very well been that I was just in deep sleep and never noticed. |
@groyoh I realized now that you probably mean taking it a step further outside of the user enabled quiet times and have it kick in automatically once the user is detected to be in sleep mode...that sounds really neat! Though I think it might be better to include it in a separate PR? Seems like you were thinking of integrating with PebbleHealth for the step count in #69 which might help pave the way for this feature as well. |
@@ -77,6 +77,7 @@ | |||
<ToggleWithItemColor toggleLabel="Use rainbow minute hand" toggleValue="{{ rainbow_mode }}" colorItemValue="{{ minute_hand_color }}" colorItemLabel="Minute hand color" footer="Overrides color selection for the minute hand" toggleFirst/> | |||
<ItemColor color="{{ time_color }}" label="Numbers and ticks color"/> | |||
<ItemColor color="{{ background_color }}" label="Background color"/> | |||
<Toggle label="Light vibration on every full hour" value="{{ vibrate_on_the_hour }}" /> |
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.
Could you change the label to "Vibrate every full hour"
?
@rezart looks good to me! 👍 I'll merge it once you fix the latest comments. Once in master, I'll test the vibrations and see if it requires to check the health service or not. |
@rezart yeah that's what I meant. Disabling it automatically as soon as the user is in sleep/deep sleep mode. Would most likely be something like: HealthActivity a = health_service_peek_current_activities();
if(a & HealthActivityNone){
vibrate();
} |
@groyoh should be ready to merge. Let's think about addressing the sleep functionality in a separate PR after testing it some more. |
@rezart I rebased your branch and merged it into master. I'm closing this PR ;) Thanks for the work! |
I really got used to the "vibrate every hour" feature that some other watch faces support and now that I fell in love with minimalin I thought I would add it as a config option
Apologies for not creating an issue beforehand but I found myself with some free time last night and implemented it anyways. Hopefully it's useful to other folks as well.