[m] Minor improvements

This commit is contained in:
choelzl 2022-05-28 15:54:18 +02:00
parent 58ba94a455
commit 9f9bb7856d
Signed by: sora
GPG Key ID: A362EA0491E2EEA0
6 changed files with 12 additions and 15 deletions

View File

@ -45,7 +45,7 @@ static OWM* owm[6] = {new OWM(LOCATION_0, OPENWEATHER_API),
new OWM(LOCATION_1, OPENWEATHER_API), new OWM(LOCATION_1, OPENWEATHER_API),
new OWM(LOCATION_2, OPENWEATHER_API), new OWM(LOCATION_2, OPENWEATHER_API),
NULL,NULL,NULL}; NULL,NULL,NULL};
static Influx* iflx = new Influx(NULL, owm);//TODO: Add sensor static Influx* iflx = new Influx(sensor, owm);//TODO: Add sensor
static TimedFun* tf = new TimedFun(); static TimedFun* tf = new TimedFun();
static bool time_update = true, view_update = true, view_refresh = false; static bool time_update = true, view_update = true, view_refresh = false;
@ -121,10 +121,10 @@ REGISTER_TIMEDFUN(NTP_TF, ntp->updateNTPtime());
void setup_TIMEDFUN() { void setup_TIMEDFUN() {
REGISTER_TIMEDFUN_CALL(NTP_TF, 60*60); REGISTER_TIMEDFUN_CALL(NTP_TF, 60*60);
REGISTER_TIMEDFUN_CALL(SENSOR_MEASURE_TF,5); REGISTER_TIMEDFUN_CALL(SENSOR_MEASURE_TF,5); // 5s LOCAL SYNC
REGISTER_TIMEDFUN_CALL(OWM_MEASURE_TF,5*60); REGISTER_TIMEDFUN_CALL(OWM_MEASURE_TF,5*60); // 5m WEATHER SYNC
// REGISTER_TIMEDFUN_CALL(RECORD_LOCAL_TF,1*60); REGISTER_TIMEDFUN_CALL(RECORD_LOCAL_TF,1*60); // 1m LOCAL DB
// REGISTER_TIMEDFUN_CALL(RECORD_WEATHER_TF,5*60); // REGISTER_TIMEDFUN_CALL(RECORD_WEATHER_TF,5*60); // 5m WEATHER DB
} }
void setup_POWER() { void setup_POWER() {

View File

@ -153,8 +153,8 @@ void LightDisplay::drawDisplay() {
Paint_DrawFltUnit(76,0,sensor->light_lux, "lux", &Font24, BLACK, WHITE); Paint_DrawFltUnit(76,0,sensor->light_lux, "lux", &Font24, BLACK, WHITE);
Paint_DrawIntUnit(76,24*1,sensor->uvi, "uvi", &Font24, BLACK, WHITE); Paint_DrawIntUnit(76,24*1,sensor->uvi, "uvi", &Font24, BLACK, WHITE);
Paint_DrawFltUnit(76,24*2,sensor->light, "l", &Font24, BLACK, WHITE); Paint_DrawIntUnit(76,24*2,sensor->light_full, "f", &Font24, BLACK, WHITE);
Paint_DrawIntUnit(76,24*3,sensor->light_vis, "vl", &Font24, BLACK, WHITE); Paint_DrawIntUnit(76,24*3,sensor->light_vis, "v", &Font24, BLACK, WHITE);
Paint_DrawString_EN(2,EPD_2IN13_V2_WIDTH - Font16.Height,"Nominal", &Font16, WHITE, BLACK); Paint_DrawString_EN(2,EPD_2IN13_V2_WIDTH - Font16.Height,"Nominal", &Font16, WHITE, BLACK);
} }

View File

@ -87,12 +87,11 @@ public:
dp.addTag("device", "WESP0"); dp.addTag("device", "WESP0");
dp.addTag("location", "local"); dp.addTag("location", "local");
dp.addField("temperature", sensor->temp); dp.addField("temperature", float(sensor->temp));
dp.addField("pressure", sensor->pres); dp.addField("pressure", int32_t(sensor->pres));
dp.addField("humidity", sensor->temp); dp.addField("humidity", int32_t(sensor->hum));
dp.addField("heat_index", sensor->heatidx); dp.addField("temperature_feel", float(sensor->heatidx));
dp.addField("light", sensor->light);
dp.addField("uv", sensor->uv); dp.addField("uv", sensor->uv);
dp.addField("uvi", sensor->uvi); dp.addField("uvi", sensor->uvi);

View File

@ -77,7 +77,7 @@ bool TSL25911::ReadData(uint32_t* dataf) {
uint8_t* data = static_cast<uint8_t*>(static_cast<void*>(dataf)); uint8_t* data = static_cast<uint8_t*>(static_cast<void*>(dataf));
bool success = WriteRegister(REG_ENABLE, ENABLE_POWERON | ENABLE_AEN); bool success = WriteRegister(REG_ENABLE, ENABLE_POWERON | ENABLE_AEN);
delay((uint32_t)atime()); delay((uint32_t)atime()+100);
success &= ReadRegister(CHAN0_LOW,&data[0],2); success &= ReadRegister(CHAN0_LOW,&data[0],2);
success &= ReadRegister(CHAN1_LOW,&data[2],2); success &= ReadRegister(CHAN1_LOW,&data[2],2);

View File

@ -24,7 +24,6 @@ public:
float hum = 0; float hum = 0;
float heatidx = 0; float heatidx = 0;
float light = 0;
uint32_t uv = 0; uint32_t uv = 0;
uint32_t uvi = 0; uint32_t uvi = 0;

View File

@ -43,7 +43,6 @@ public:
e.first(); e.first();
} }
} }
old_counter = counter;
}; };
void updateForce() { void updateForce() {