Renamed fasting window to eating window as to make more sense

This commit is contained in:
Warwick New 2026-06-25 15:35:05 +01:00
parent 60289b6175
commit 296bda9061
4 changed files with 17 additions and 17 deletions

View file

@ -29,8 +29,8 @@
"messageKeys": [ "messageKeys": [
"BackgroundColor", "BackgroundColor",
"ForegroundColor", "ForegroundColor",
"FastBegin", "EatingWindowBegin",
"FastEnd" "EatingWindowEnd"
], ],
"resources": { "resources": {
"media": [] "media": []

View file

@ -13,8 +13,8 @@ static ClaySettings settings;
static void default_settings() { static void default_settings() {
settings.BackgroundColor = GColorBlack; settings.BackgroundColor = GColorBlack;
settings.ForegroundColor = GColorWhite; settings.ForegroundColor = GColorWhite;
settings.FastBegin = "12:00"; settings.EatingWindowBegin = "12:00";
settings.FastEnd = "20:00"; settings.EatingWindowEnd = "20:00";
} }
// Read settings from persistent storage // Read settings from persistent storage
@ -47,15 +47,15 @@ static void inbox_recieved_callback(DictionaryIterator *iter, void *context) {
} }
// Second Tick // Second Tick
Tuple *fast_begin_t = dict_find(iter, MESSAGE_KEY_FastBegin); Tuple *fast_begin_t = dict_find(iter, MESSAGE_KEY_EatingWindowBegin);
if (fast_begin_t) { if (fast_begin_t) {
settings.FastBegin = fast_begin_t->value->cstring; settings.EatingWindowBegin = fast_begin_t->value->cstring;
} }
// Animations // Animations
Tuple *fast_end_t = dict_find(iter, MESSAGE_KEY_FastEnd); Tuple *fast_end_t = dict_find(iter, MESSAGE_KEY_EatingWindowEnd);
if (fast_end_t) { if (fast_end_t) {
settings.FastEnd = fast_end_t->value->cstring; settings.EatingWindowEnd = fast_end_t->value->cstring;
} }
// Save the new settings to persistent storage // Save the new settings to persistent storage
@ -85,8 +85,8 @@ static void update_time() {
static const char eatmsg[] = "Eat"; static const char eatmsg[] = "Eat";
static const char donteatmsg[] = "Don't Eat"; static const char donteatmsg[] = "Don't Eat";
time_t fast_start = parse_time_str(settings.FastBegin); time_t fast_start = parse_time_str(settings.EatingWindowBegin);
time_t fast_end = parse_time_str(settings.FastEnd); time_t fast_end = parse_time_str(settings.EatingWindowEnd);
if (now >= fast_start && now < fast_end) { if (now >= fast_start && now < fast_end) {
text_layer_set_text(s_eat_layer, eatmsg); text_layer_set_text(s_eat_layer, eatmsg);

View file

@ -7,8 +7,8 @@
typedef struct ClaySettings { typedef struct ClaySettings {
GColor BackgroundColor; GColor BackgroundColor;
GColor ForegroundColor; GColor ForegroundColor;
char *FastBegin; char *EatingWindowBegin;
char *FastEnd; char *EatingWindowEnd;
} __attribute__((__packed__)) ClaySettings; } __attribute__((__packed__)) ClaySettings;
static void default_settings(); static void default_settings();

View file

@ -33,12 +33,12 @@ module.exports = [
"items": [ "items": [
{ {
"type": "heading", "type": "heading",
"defaultValue": "Fasting Period (24hr format)" "defaultValue": "Eating Window (24hr format)"
}, },
{ {
"type": "input", "type": "input",
"messageKey": "FastBegin", "messageKey": "EatingWindowBegin",
"label": "Time your fast begins", "label": "Time your eating window begins",
"attributes": { "attributes": {
"placeholder": "12:00", "placeholder": "12:00",
"limit": 5, "limit": 5,
@ -47,8 +47,8 @@ module.exports = [
}, },
{ {
"type": "input", "type": "input",
"messageKey": "FastEnd", "messageKey": "EatingWindowEnd",
"label": "Time your fast ends", "label": "Time your eating window ends",
"attributes": { "attributes": {
"placeholder": "20:00", "placeholder": "20:00",
"limit": 5, "limit": 5,