...
Info | ||||
---|---|---|---|---|
| ||||
if (heating == "normal") { temp = 70; } else { temp = 50; } |
Expected results
For each mode and state block an associated string variable will be created.
As the hour variable changes its value, the time will toggle between "daytime" and "nighttime".
As the dayNumber variable changes its value, the day will toggle between "weekend" and "weekday".
When time is "daytime" and day is "weekday" the heating is "normal". Otherwise (when time is "nighttime" or day is "weekend", the heating is "economical").
If the heating is "normal", temp will be set to 70, otherwise if it is "economical", temp will be set to 50.