Skip to content

feat(weather): add showSunshineHours option - #4292

Closed
ms-zone-41 wants to merge 1 commit into
MagicMirrorOrg:developfrom
ms-zone-41:feat/weather-sunshine-hours
Closed

ms-zone-41 wants to merge 1 commit into
MagicMirrorOrg:developfrom
ms-zone-41:feat/weather-sunshine-hours

Conversation

@ms-zone-41

@ms-zone-41 ms-zone-41 commented Oct 3, 2026 •

Copy link
Copy Markdown

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 showSunshineHours option 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

  • New option showSunshineHours (default false):
    • current: shows today's sunshine hours next to the sunrise/sunset time
    • forecast: adds a sunshine column. Like the other columns, it can be reordered with the CSS variable --weather-forecast-sunshine-hours-order (default 8).
  • Providers can deliver the new sunshineHours value. This PR implements it for Open-Meteo (daily sunshine_duration, converted from seconds to hours). The Bright Sky provider from feat(weather): add Bright Sky provider #4291 delivers it as well.
  • The value is shown as <n> h, so no new translation key is needed.
  • Tests: a unit test for the Open-Meteo conversion and E2E tests for current weather, forecast and the disabled default.

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:

showSunshineHours

Testing

  • npx vitest run tests/unit/modules/default/weather (226 tests pass)
  • npx vitest run tests/e2e/modules/weather_sunshine_spec.js
  • node --run test:lint and node --run test:spelling for the changed files

I used an AI coding assistant to help prepare this change. I reviewed and tested it myself.

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.
@KristjanESPERANTO

Copy link
Copy Markdown
Collaborator

@ms-zone-41 Thanks for the PRs :) Why are they all marked as draft?

@ms-zone-41

Copy link
Copy Markdown
Author

@ms-zone-41 Thanks for the PRs :) Why are they all marked as draft?

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.
Unfortunatly, I'm now out of tokens - waiting for the reset to come. PRs are in draft state because my final manual + AI review is missing.

@ms-zone-41

Copy link
Copy Markdown
Author

sorry, this PR was created too early
Nevertheless, it is a good time to say thank you to all reading the message for driving forward this great mirror platform.

@ms-zone-41 ms-zone-41 closed this Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants