fix new time matching if QTime is not initialized

This commit is contained in:
WarmUpTill
2020-12-28 17:02:32 +01:00
parent 3a05e61814
commit 80e2b3dd14
2 changed files with 4 additions and 1 deletions

View File

@@ -20,7 +20,7 @@ typedef enum {
struct TimeSwitch : SceneSwitcherEntry {
timeTrigger trigger = ANY_DAY;
QTime time = QTime();
QTime time = QTime(0, 0);
const char *getType() { return "time"; }

View File

@@ -74,6 +74,9 @@ void AdvSceneSwitcher::on_timeDown_clicked()
bool timesAreInInterval(QTime &time1, QTime &time2, int &interval)
{
if (time1.isNull() || time2.isNull())
return false;
bool ret = false;
QTime validSwitchTimeWindow = time1.addMSecs(interval);