Merge pull request #532 from jonls/fix-time-based

Fix missing checks and verbose output
This commit is contained in:
Jon Lund Steffensen
2017-10-12 13:28:57 -07:00
committed by GitHub
+17 -12
View File
@@ -1760,14 +1760,27 @@ main(int argc, char *argv[])
}
}
/* Solar elevations */
if (scheme.high < scheme.low) {
fprintf(stderr,
_("High transition elevation cannot be lower than"
" the low transition elevation.\n"));
exit(EXIT_FAILURE);
}
if (verbose) {
/* TRANSLATORS: Append degree symbols if possible. */
printf(_("Solar elevations: day above %.1f, night below %.1f\n"),
scheme.high, scheme.low);
}
}
if (mode != PROGRAM_MODE_RESET &&
mode != PROGRAM_MODE_MANUAL) {
if (verbose) {
printf(_("Temperatures: %dK at day, %dK at night\n"),
scheme.day.temperature,
scheme.night.temperature);
/* TRANSLATORS: Append degree symbols if possible. */
printf(_("Solar elevations: day above %.1f, night below %.1f\n"),
scheme.high, scheme.low);
}
/* Color temperature */
@@ -1780,14 +1793,6 @@ main(int argc, char *argv[])
MIN_TEMP, MAX_TEMP);
exit(EXIT_FAILURE);
}
/* Solar elevations */
if (scheme.high < scheme.low) {
fprintf(stderr,
_("High transition elevation cannot be lower than"
" the low transition elevation.\n"));
exit(EXIT_FAILURE);
}
}
if (mode == PROGRAM_MODE_MANUAL) {