<commit_before>#include "Defines.h"
#include "TemperatureProfiles.h"
#include "Tools.h"

namespace TemperatureProfiles{

  byte getNbProfiles(){
    g_eeprom.setCurrentBaseAddr( EEPROM_PROFILES_BASE );
    return g_eeprom.read();
  }
  
  void setCurrentProfile( byte id ){
    g_eeprom.setCurrentBaseAddr( EEPROM_PROFILES_BASE );
    g_eeprom.setPosition( 1 + (int)id * 2 );
    g_eeprom.setPosition( g_eeprom.readInt() );
    g_nbValues = g_eeprom.read();
  }
  
  byte getDays( int idx ){
    return g_eeprom.at( idx * 3 + 0 ) / 10.f;
  }
    
  byte getStartTime( int idx ){
    return g_eeprom.at( idx * 3 + 1 );
  }
    
  float getTemp( int idx ){
    return g_eeprom.at( idx * 3 + 2 ) / 10.f;
  }
    
  float temp( byte day, byte hour, byte min ){
    float temp = -1.f;
    do{
      byte dow = 1 << day;
      byte now  = hour * 10 + min / 10;
      byte next = 0;
      for( int i = 0; i < g_nbValues; ++i ){
        byte startTime = getStartTime( i );
        if ( getDays( i ) & dow && startTime <= now && startTime >= next ){<commit_msg>Changes time interval of temperature profiles<commit_after>#include "Defines.h"
#include "TemperatureProfiles.h"
#include "Tools.h"

namespace TemperatureProfiles{

  byte getNbProfiles(){
    g_eeprom.setCurrentBaseAddr( EEPROM_PROFILES_BASE );
    return g_eeprom.read();
  }
  
  void setCurrentProfile( byte id ){
    g_eeprom.setCurrentBaseAddr( EEPROM_PROFILES_BASE );
    g_eeprom.setPosition( 1 + (int)id * 2 );
    g_eeprom.setPosition( g_eeprom.readInt() );
    g_nbValues = g_eeprom.read();
  }
  
  byte getDays( int idx ){
    return g_eeprom.at( idx * 3 + 0 ) / 10.f;
  }
    
  byte getStartTime( int idx ){
    return g_eeprom.at( idx * 3 + 1 );
  }
    
  float getTemp( int idx ){
    return g_eeprom.at( idx * 3 + 2 ) / 10.f;
  }
    
  float temp( byte day, byte hour, byte min ){
    float temp = -1.f;
    do{
      byte dow = 1 << day;
      byte now  = hour * 10 + min / 15;
      byte next = 0;
      for( int i = 0; i < g_nbValues; ++i ){
        byte startTime = getStartTime( i );
        if ( getDays( i ) & dow && startTime <= now && startTime >= next ){
{'fraction_non_alphanumeric': 0.12921348314606743, 'fraction_numerical': 0.018726591760299626, 'mean_word_length': 2.5380794701986753, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7113518', 'n_tokens_mistral': 856, 'n_tokens_neox': 803, 'n_words': 207}