We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f72db5d commit 088cf32Copy full SHA for 088cf32
1 file changed
src/night.c
@@ -76,11 +76,9 @@ void *night_thread(void) {
76
} else {
77
while (keepRunning) {
78
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);
+ if (!gpio_read(app_config.ir_sensor_pin, &state))
+ if (!manual) night_mode(state);
+
84
sleep(app_config.check_interval_s);
85
}
86
@@ -118,4 +116,4 @@ void disable_night(void) {
118
116
119
117
nightOn = 0;
120
pthread_join(nightPid, NULL);
121
-}
+}
0 commit comments