inputs: circadianrhythm: move strings to flashmem, merge duplicate loop algo
This commit is contained in:
parent
a5d468efde
commit
0106b09c9b
@ -37,14 +37,9 @@ class CircadianRhythm : public InputSource {
|
||||
// Find the last hour that is prior to or equal to now
|
||||
if (cur.hour <= hour) {
|
||||
start = cur;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
for(ScheduleEntry cur : schedule) {
|
||||
// Find the first hour that is after now
|
||||
// If no such hour exists, we should automatically wrap back to hour 0
|
||||
if (cur.hour > hour) {
|
||||
} else if (cur.hour > hour) {
|
||||
end = cur;
|
||||
break;
|
||||
}
|
||||
@ -83,9 +78,9 @@ class CircadianRhythm : public InputSource {
|
||||
hour = 0;
|
||||
minute = 0;
|
||||
}
|
||||
Log.notice("Current time: %d:%d", hour, minute);
|
||||
Log.notice(F("Current time: %d:%d"), hour, minute);
|
||||
auto brightness = brightnessForTime(hour, minute);
|
||||
Log.notice("Adjusting brightness to %d", brightness);
|
||||
Log.notice(F("Adjusting brightness to %d"), brightness);
|
||||
return InputEvent{InputEvent::SetBrightness, brightness};
|
||||
}
|
||||
return InputEvent{};
|
||||
|
Loading…
Reference in New Issue
Block a user