Repository navigation
feat(weather): add showSunshineHours option - #4292
Closed
ms-zone-41 wants to merge 1 commit into
Closed
ms-zone-41 wants to merge 1 commit into
ms-zone-41 wants to merge 1 commit into
Conversation
Adds an opt-in showSunshineHours option (default false) that shows the sunshine duration in hours: - current: sunshine of today next to the sunrise/sunset time - forecast: an additional sunshine-hours column, which can be reordered with --weather-forecast-sunshine-hours-order like the other columns Providers can deliver the new sunshineHours value. Implemented for Open-Meteo (daily sunshine_duration). The value is shown as "<n> h", so no new translation key is needed.
Collaborator
|
@ms-zone-41 Thanks for the PRs :) Why are they all marked as draft? |
Author
I'm using MM now for quite some time and I'm very happy with it - thanks for that aweseome project and everyone involved. I fixed some issues for my local MM and also improved a few things. Now, after a year I thought it is a good time to contribute something back. |
Author
|
sorry, this PR was created too early |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Draft – please do not review yet. I am still doing my own final review of this change. I will mark this PR as ready for review when it is done.
This PR adds an opt-in
showSunshineHoursoption to the weather module. Sunshine duration is a useful value for planning the day, and some providers already deliver it.Related issue
No related issue.
Changes
showSunshineHours(defaultfalse):current: shows today's sunshine hours next to the sunrise/sunset timeforecast: adds a sunshine column. Like the other columns, it can be reordered with the CSS variable--weather-forecast-sunshine-hours-order(default 8).sunshineHoursvalue. This PR implements it for Open-Meteo (dailysunshine_duration, converted from seconds to hours). The Bright Sky provider from feat(weather): add Bright Sky provider #4291 delivers it as well.<n> h, so no new translation key is needed.The grid now defines 8 column tracks. If #4290 gets merged first, I will add the sunshine column to the column count there.
Screenshot
Open-Meteo with live data:
Testing
npx vitest run tests/unit/modules/default/weather(226 tests pass)npx vitest run tests/e2e/modules/weather_sunshine_spec.jsnode --run test:lintandnode --run test:spellingfor the changed filesI used an AI coding assistant to help prepare this change. I reviewed and tested it myself.