scripter compile error fix (#20140)

compile error if rules are disabled fixed
This commit is contained in:
stefanbode 2023-12-01 17:14:09 +01:00 committed by GitHub
parent 8ee071b8b8
commit 45ba50bb2f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -52,9 +52,11 @@ uint8_t deepsleep_flag = 0;
bool DeepSleepEnabled(void)
{
#if defined(USE_RULES) && defined(USE_TIMERS)
if (GetRule(0) == "Wakeup" && bitRead(Settings->rule_enabled | Settings->rule_once, 0)) {
return true;
}
#endif
if ((Settings->deepsleep < 10) || (Settings->deepsleep > DEEPSLEEP_MAX)) {
Settings->deepsleep = 0; // Issue #6961
return false; // Disabled