Exemplo n.º 1
0
/*
 * Do menu action after shutting the menu and allowing time for the animations to complete
 */
static void do_long_menu_action(void *data) {
  preset_data.fromhr[selected_row] = get_config_data()->fromhr;
  preset_data.frommin[selected_row] = get_config_data()->frommin;
  preset_data.tohr[selected_row] = get_config_data()->tohr;
  preset_data.tomin[selected_row] = get_config_data()->tomin;
  preset_data.from[selected_row] = get_config_data()->from;
  preset_data.to[selected_row] = get_config_data()->to;
  save_preset_data();
}
Exemplo n.º 2
0
/*
 * Do menu action after shutting the menu and allowing time for the animations to complete
 */
static void do_menu_action(void *data) {
  uint8_t no = menu_def[selected_row].no;
  if (menu_def[selected_row].set) {
    preset_data.fromhr[no] = get_config_data()->fromhr;
    preset_data.frommin[no] = get_config_data()->frommin;
    preset_data.tohr[no] = get_config_data()->tohr;
    preset_data.tomin[no] = get_config_data()->tomin;
    preset_data.from[no] = get_config_data()->from;
    preset_data.to[no] = get_config_data()->to;
    save_preset_data();
  } else {
    get_config_data()->fromhr = preset_data.fromhr[no];
    get_config_data()->frommin = preset_data.frommin[no];
    get_config_data()->tohr = preset_data.tohr[no];
    get_config_data()->tomin = preset_data.tomin[no];
    get_config_data()->from = preset_data.from[no];
    get_config_data()->to = preset_data.to[no];    
    get_config_data()->smart = true;
    resend_all_data(true); // Force resend - we've fiddled with the times
    trigger_config_save();
    set_smart_status();
  }
}