Tunable parameters of the activity insights.
More...
Tunable parameters of the activity insights.
Settings are stored per insight, keyed by name, in the insights settings file. Built-in defaults are used for insights missing from the file.
uint16_t delay_s = settings.reward.sleep.trigger_after_wakeup_seconds;
}
bool enabled
Insight enabled.
Definition insights_settings.h:144
Settings of one insight.
Definition insights_settings.h:138
bool activity_insights_settings_read(const char *insight_name, ActivityInsightSettings *settings_out)
Read the settings of an insight.
#define ACTIVITY_INSIGHTS_SETTINGS_SLEEP_REWARD
Key of the sleep reward settings.
Definition insights_settings.h:31
◆ ActivityRewardSettings
| struct ActivityRewardSettings |
Reward insight settings.
Day counts are in addition to today.
| Data Fields |
|
union ActivityRewardSettings.__unnamed58__ |
__unnamed__ |
Insight specific settings. |
|
uint8_t |
continuous_min_days_data |
Consecutive days of history required. |
|
uint8_t |
min_days_data |
Days of history required. |
|
uint32_t |
notif_min_interval_seconds |
Minimum interval between two notifications of this insight, in seconds. |
|
uint16_t |
target_percent_of_median |
Percentage of the median that qualifying days must reach. |
|
uint8_t |
target_qualifying_days |
Days that must be above target, in addition to today. |
◆ ActivitySummarySettings
| struct ActivitySummarySettings |
Summary pin settings.
Thresholds are percentages relative to 100% of the average: 105% is 5, 93% is -7.
| Data Fields |
|
union ActivitySummarySettings.__unnamed62__ |
__unnamed__ |
Insight specific settings. |
|
int8_t |
above_avg_threshold |
Values above this are above average. |
|
int8_t |
below_avg_threshold |
Values below this are below average. |
|
int8_t |
fail_threshold |
Values below this are a fail. |
◆ ActivitySessionSettings
| struct ActivitySessionSettings |
Activity session insight settings.
◆ ActivityInsightSettings
| struct ActivityInsightSettings |
| Data Fields |
|
union ActivityInsightSettings.__unnamed69__ |
__unnamed__ |
Insight specific settings. |
|
bool |
enabled |
Insight enabled. |
|
uint8_t |
unused |
Unused. |
|
uint8_t |
version |
Struct version, must be first. Records with another version are ignored.
|
◆ ActivityRewardSettings.__unnamed58__
| union ActivityRewardSettings.__unnamed58__ |
Insight specific settings.
◆ ActivityRewardSettings.__unnamed58__.sleep
| struct ActivityRewardSettings.__unnamed58__.sleep |
| Data Fields |
|
uint16_t |
trigger_after_wakeup_seconds |
Delay after waking up before showing the reward, in seconds. |
◆ ActivityRewardSettings.__unnamed58__.activity
| struct ActivityRewardSettings.__unnamed58__.activity |
Activity reward settings.
| Data Fields |
|
uint8_t |
trigger_active_minutes |
Minutes the user must currently have been active before showing the reward. |
|
uint8_t |
trigger_steps_per_minute |
Steps per minute required for an active minute. |
◆ ActivitySummarySettings.__unnamed62__
| union ActivitySummarySettings.__unnamed62__ |
Insight specific settings.
◆ ActivitySummarySettings.__unnamed62__.activity
| struct ActivitySummarySettings.__unnamed62__.activity |
Activity summary settings.
| Data Fields |
|
uint16_t |
max_fail_steps |
Do not show a negative summary above this many steps. |
|
bool |
show_notification |
Whether to show a notification. |
|
uint16_t |
trigger_minute |
Minute of the day at which the pin is added. |
|
uint32_t |
update_max_interval_seconds |
Maximum time without updating the pin, in seconds. |
|
uint16_t |
update_threshold_steps |
Step change that causes the pin to be updated. |
◆ ActivitySummarySettings.__unnamed62__.sleep
| struct ActivitySummarySettings.__unnamed62__.sleep |
| Data Fields |
|
uint16_t |
max_fail_minutes |
Do not show a negative summary above this many minutes of sleep. |
|
uint8_t |
trigger_notif_active_minutes |
Minimum active minutes to trigger the notification. |
|
uint16_t |
trigger_notif_activity |
Minimum steps per minute to trigger the notification. |
|
uint16_t |
trigger_notif_seconds |
Delay after waking up before the notification, in seconds. |
◆ ActivitySessionSettings.__unnamed66__
| union ActivitySessionSettings.__unnamed66__ |
Session type specific settings.
◆ ActivitySessionSettings.__unnamed66__.activity
| struct ActivitySessionSettings.__unnamed66__.activity |
| Data Fields |
|
uint16_t |
trigger_cooldown_minutes |
Delay after the end of the session before notifying, in minutes. |
|
uint16_t |
trigger_elapsed_minutes |
Minimum session length to get an insight, in minutes. |
◆ ActivityInsightSettings.__unnamed69__
| union ActivityInsightSettings.__unnamed69__ |
Insight specific settings.
◆ ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_REWARD
| #define ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_REWARD "activity_reward" |
Key of the activity reward settings.
◆ ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_SESSION
| #define ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_SESSION "activity_session" |
Key of the activity session settings.
◆ ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_SUMMARY
| #define ACTIVITY_INSIGHTS_SETTINGS_ACTIVITY_SUMMARY "activity_summary" |
Key of the activity summary settings.
◆ ACTIVITY_INSIGHTS_SETTINGS_SLEEP_REWARD
| #define ACTIVITY_INSIGHTS_SETTINGS_SLEEP_REWARD "sleep_reward" |
Key of the sleep reward settings.
◆ ACTIVITY_INSIGHTS_SETTINGS_SLEEP_SUMMARY
| #define ACTIVITY_INSIGHTS_SETTINGS_SLEEP_SUMMARY "sleep_summary" |
Key of the sleep summary settings.
◆ activity_insights_settings_get_version()
| uint16_t activity_insights_settings_get_version |
( |
void |
| ) |
|
◆ activity_insights_settings_init()
| void activity_insights_settings_init |
( |
void |
| ) |
|
Initialize the insights settings file.
◆ activity_insights_settings_read()
Read the settings of an insight.
Falls back to the built-in defaults when the file has no valid record for the insight.
- Parameters
-
- Returns
- true if settings were found, false otherwise.
◆ activity_insights_settings_unwatch()
| void activity_insights_settings_unwatch |
( |
struct pbl_fs_watch * |
watch | ) |
|
Stop watching the insights settings file.
- Parameters
-
◆ activity_insights_settings_watch()
Watch the insights settings file.
- Parameters
-
| callback | Called when the file is closed after modifications, or deleted. |
- Returns
- Watch for activity_insights_settings_unwatch(), NULL if the activity service is not initialized.
◆ activity_insights_settings_write()
Write the settings of an insight (testing).
- Parameters
-
| insight_name | Insight key. |
| settings | Settings. |
- Returns
- true if saved.