Fixed rendering bug.

This commit is contained in:
Marcus Scholz 2021-10-09 11:18:12 +02:00
parent 75e154f1bd
commit f2fc5e391a

View File

@ -286,13 +286,13 @@ display:
strptime(id(sun_rise).state.c_str(), "%Y-%m-%dT%H:%M:%S", &tm);
time_t rawtime = mktime(&tm);
struct tm* ltm = localtime(&rawtime);
sprintf(sunrise, "%d:%d", ltm->tm_hour + dst, ltm->tm_min);
sprintf(sunrise, "%d:%02d", ltm->tm_hour + dst, ltm->tm_min);
memset (&tm, 0, sizeof (tm));
strptime(id(sun_set).state.c_str(), "%Y-%m-%dT%H:%M:%S", &tm);
rawtime = mktime(&tm);
ltm = localtime(&rawtime);
sprintf(sunset, "%d:%d", ltm->tm_hour + dst, ltm->tm_min);
sprintf(sunset, "%d:%02d", ltm->tm_hour + dst, ltm->tm_min);
/* OUTSIDE */
@ -427,7 +427,7 @@ display:
/* Sleepingroom */
offsetY = 247;
it.print(10, 10 + offsetY, id(big_sensor_unit), "Schlafzimmer");
it.filled_rectangle(136, 21 + offsetY, 247, 3);
it.filled_rectangle(144, 21 + offsetY, 239, 3);
it.print(10, 114 + offsetY, id(mdi_small), TextAlign::BASELINE_LEFT, "󰮬"); // PM2.5
it.print(375, 75 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰔏"); // thermometer
it.print(375, 115 + offsetY, id(mdi_small), TextAlign::BASELINE_CENTER, "󰖎"); // water percent