Skip to content

Commit 088cf32

Browse files
committed
Resolving IR sensor bypass in the night module
1 parent f72db5d commit 088cf32

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

src/night.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,9 @@ void *night_thread(void) {
7676
} else {
7777
while (keepRunning) {
7878
bool state = false;
79-
if (!gpio_read(app_config.ir_sensor_pin, &state)) {
80-
sleep(app_config.check_interval_s);
81-
continue;
82-
}
83-
if (!manual) night_mode(night_mode);
79+
if (!gpio_read(app_config.ir_sensor_pin, &state))
80+
if (!manual) night_mode(state);
81+
8482
sleep(app_config.check_interval_s);
8583
}
8684
}
@@ -118,4 +116,4 @@ void disable_night(void) {
118116

119117
nightOn = 0;
120118
pthread_join(nightPid, NULL);
121-
}
119+
}

0 commit comments

Comments
 (0)