kloggy / HA-Irrigation-Version2

225 stars 55 forks source link

Status: planned for tomorrow issue #4

Closed akarpenkoua closed 4 years ago

akarpenkoua commented 4 years ago

file /config/templates/garden/status/section_status_header.yaml

Wrong logic:

else if (cycle1_schedule_enabled == 'on' && cycle1_runs_today && cycle1_start_time > time_now) return cycle1_name + ' at ' + cycle1_start_time; else if (cycle2_schedule_enabled == 'on' && cycle2_runs_today && cycle2_start_time > time_now) return cycle2_name + ' at ' + cycle2_start_time; else if (cycle1_schedule_enabled == 'on' && cycle1_runs_tomorrow && cycle1_start_time < time_now) return 'Tomorrow at ' + cycle1_start_time; else if (cycle2_schedule_enabled == 'on' && cycle2_runs_tomorrow && cycle2_start_time < time_now) return 'Tomorrow at ' + cycle2_start_time; else return 'NOTHING SCHEDULED';

code lines fixed:

else if (cycle1_schedule_enabled == 'on' && cycle1_runs_today && cycle1_start_time > time_now) return cycle1_name + ' at ' + cycle1_start_time; else if (cycle2_schedule_enabled == 'on' && cycle2_runs_today && cycle2_start_time > time_now) return cycle2_name + ' at ' + cycle2_start_time; else if (cycle1_schedule_enabled == 'on' && cycle1_runs_tomorrow) return 'Tomorrow at ' + cycle1_start_time; else if (cycle2_schedule_enabled == 'on' && cycle2_runs_tomorrow) return 'Tomorrow at ' + cycle2_start_time; else return 'NOTHING SCHEDULED';

kloggy commented 4 years ago

Yes, you are right! Thank you. Updated.