Fix low fuel indicator configuration
This commit is contained in:
+6
-6
@@ -56,10 +56,10 @@ static const uint8_t s_bar_spacing = s_bar_height + 1;
|
||||
static void batt_callback(BatteryChargeState state) {
|
||||
s_batt_level = state.charge_percent / 5;
|
||||
layer_mark_dirty(s_fuel_layer);
|
||||
if (!s_low_fuel_indicator && s_batt_level <= settings.LowFuelBars && settings.LowFuelBars != 21) {
|
||||
if (!s_low_fuel_indicator && state.charge_percent <= settings.LowFuelPercent) {
|
||||
replace_gbitmap_color(s_applied_fg, settings.ColorWarning, s_e_icon, s_e_layer);
|
||||
s_low_fuel_indicator = true;
|
||||
} else if (s_low_fuel_indicator && s_batt_level > settings.LowFuelBars) {
|
||||
} else if (s_low_fuel_indicator && state.charge_percent > settings.LowFuelPercent) {
|
||||
replace_gbitmap_color(settings.ColorWarning, s_applied_fg, s_e_icon, s_e_layer);
|
||||
s_low_fuel_indicator = false;
|
||||
}
|
||||
@@ -377,7 +377,7 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
||||
Tuple *track_bt_tuple = dict_find(iter, MESSAGE_KEY_CLAY_BT_INDICATOR);
|
||||
Tuple *show_time_mg_tuple = dict_find(iter, MESSAGE_KEY_CLAY_SHOW_TIME_MG);
|
||||
Tuple *date_timeout_tuple = dict_find(iter, MESSAGE_KEY_CLAY_DATE_TIMEOUT);
|
||||
Tuple *low_fuel_bars_tuple = dict_find(iter, MESSAGE_KEY_CLAY_LOW_FUEL_BARS);
|
||||
Tuple *low_fuel_percent_tuple = dict_find(iter, MESSAGE_KEY_CLAY_LOW_FUEL_PERCENT);
|
||||
Tuple *color_led_tuple = dict_find(iter, MESSAGE_KEY_CLAY_LED_COLOR);
|
||||
Tuple *color_bg_tuple = dict_find(iter, MESSAGE_KEY_CLAY_BG_COLOR);
|
||||
Tuple *color_mg_bar_tuple = dict_find(iter, MESSAGE_KEY_CLAY_BAR_MG_COLOR);
|
||||
@@ -395,8 +395,8 @@ static void inbox_received_handler(DictionaryIterator *iter, void *context) {
|
||||
if (date_timeout_tuple) {
|
||||
settings.DateTimeoutSecs = date_timeout_tuple->value->uint8;
|
||||
}
|
||||
if (low_fuel_bars_tuple) {
|
||||
settings.LowFuelBars = low_fuel_bars_tuple->value->uint8;
|
||||
if (low_fuel_percent_tuple) {
|
||||
settings.LowFuelPercent = low_fuel_percent_tuple->value->uint8;
|
||||
}
|
||||
if (color_led_tuple) {
|
||||
settings.ColorLED = GColorFromHEX(color_led_tuple->value->int32);
|
||||
@@ -434,7 +434,7 @@ static void init() {
|
||||
settings.TrackBTStatus = false;
|
||||
settings.ShowTimeMG = false;
|
||||
settings.DateTimeoutSecs = 3;
|
||||
settings.LowFuelBars = 2;
|
||||
settings.LowFuelPercent = 20;
|
||||
settings.ColorLED = GColorWhite;
|
||||
settings.ColorBG = GColorBlue;
|
||||
settings.ColorMGBars = GColorDarkGray;
|
||||
|
||||
Reference in New Issue
Block a user