Commit Graph

1486 Commits

Author SHA1 Message Date
Blackspirits
1796400ab9 Add new pt and pt-BR translations for Alert module and update global PT strings (#3965)
- Added new pt.json and pt-br.json in alert/translations
- Updated main pt.json (global translations)
- Updated alert.js to load new languages
- Added entry to CHANGELOG.md

---------

Co-authored-by: veeck <gitkraken@veeck.de>
2025-11-16 09:59:41 +01:00
Kristjan ESPERANTO
3c4d69ea84 [calendar] refactor: migrate CalendarFetcher to ES6 class and improve error handling (#3959)
1. Convert CalendarFetcher from legacy constructor function pattern to
ES6 class (which simplifies future migration from CommonJS to ES
modules).
2. Implement targeted HTTP error handling with smart retry strategies
for common calendar feed issues:
   - 401/403: Extended retry delay (5× interval, min 30 min)
   - 429: Retry-After header parsing with 15 min fallback
   - 5xx: Exponential backoff (2^count, max 3 retries)
   - 4xx: Extended retry (2× interval, min 15 min)
   - Add serverErrorCount tracking for exponential backoff
- Error messages now include specific HTTP status codes and calculated
retry delays for better debugging and user feedback

Previously, CalendarFetcher did not respond appropriately to HTTP
errors, continuing to hammer endpoints without backoff, potentially
overloading servers and triggering rate limits. This refactoring
implements respectful retry strategies that adapt to server responses
and reduce unnecessary load.

Maybe we could later centralize the HTTP error handling and use it for
weather and newsfeed as well.

The PR was inspired by having worked on the calendar fetcher for
MMM-CalendarExt2, where there was already better error handling.
2025-11-14 20:14:23 +01:00
Jordan Welch
53df20f313 [weatherprovider] update subclass language use override (#3914) 2025-11-13 22:08:47 +01:00
Veeck
38a4d235e8 [weather] fix wind-icon not showing in pirateweather (#3957)
fixes #3956

---------

Co-authored-by: veeck <gitkraken@veeck.de>
2025-11-10 21:41:24 +01:00
Kristjan ESPERANTO
2b08288346 [core] configure cspell to check default modules only and fix typos (#3955)
When I saw PR #3951, I wondered why `cspell` didn't catch these typos
before. Unfortunately, the default modules were excluded from the check.
I have corrected this with these changes.

This even revealed a code error in
`modules/default/weather/providers/overrideWrapper.js`:

- before: `fetchEatherHourly`
- after: `fetchWeatherHourly`
2025-11-08 20:27:34 +01:00
sam detweiler
c1aaea5913 [weather] add error handling to weather fetch functions, including cors (#3791)
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
fixes #3687
2025-11-08 14:21:31 +01:00
Jarno
3b79791a6b [calendar] Show repeatingCountTitle only if yearDiff > 0 (#3949) 2025-11-08 14:13:59 +01:00
Karsten Hassel
ab5f79a1be remove deprecated ukmetoffice datapoint provider, cleanup .gitignore (#3952)
- weather ukmetoffice see #3842 , I got a final reminder today per mail
that datapoint will be retired on Dec. 1st.
- cleanup/simplify `.gitignore`
2025-11-07 08:45:20 +01:00
Veeck
034f3c4b2a [newsfeed] fix header layout issue (#3946)
... fixes #3944 introduced with prettier njk linting

---------

Co-authored-by: veeck <gitkraken@veeck.de>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
2025-11-05 18:09:30 +01:00
Kristjan ESPERANTO
d7348ed765 [tests] suppress debug logs in CI environment + improve calendar symbol test stability (#3941)
## CI Log Suppression

**Two-level approach for clean test output:**

1. **Suppress debug/info logs**: Call `logger.setLogLevel("ERROR")` in
CI to hide verbose logging
2. **Suppress intentional error logs**: Set `mmTestMode` flag and check
it before logging errors that are part of test assertions (e.g., testing
error handling in `git_helper.js` and `server_functions.js`)

This keeps CI output clean and makes genuine failures immediately
visible, while preserving full logging for local development.

**Before:** 1348 log lines with verbose debug/info output  
**After:** 168 log clean lines with only test results

## Calendar Symbol Test Stability

Convert the calendar symbol test from external URL (`calendarlabs.com`)
to existing local mock file (`12_events.ics`). This eliminates CI
timeouts caused by external dependencies and improves test reliability.

The test still validates the same symbol array feature but now runs
faster and deterministically without network dependencies.
2025-11-03 23:49:21 +01:00
Karsten Hassel
1e5d127d44 fixes problems with daylight-saving-time in weather provider openmeteo (#3931)
fix for #3930
2025-11-01 13:46:58 +01:00
Kristjan ESPERANTO
2e795f6552 [calendar] chore: remove requiresVersion: "2.1.0" (#3932)
This is just to reduce a little noise in the dev console. The following
line will not appear with this change:

```shell
module.js:480 Check MagicMirror² version for module 'calendar' - Minimum version:  2.1.0 - Current version: 2.34.0-
```

Since version 2.1.0 is so old, we can surely throw it out without
concern.
2025-10-27 09:48:17 +01:00
Karsten Hassel
bc0d36503a logger: add calling filename as prefix on server side (#3926) 2025-10-22 22:50:31 +02:00
Veeck
a1c1e9560c [logger] Add prefixes to most Log messages (#3923)
Co-authored-by: veeck <gitkraken@veeck.de>
2025-10-21 20:32:48 +02:00
Kevin G.
2a4a056c84 Fix for envcanada Provider to use updated Env Canada URL (#3919)
The envcanada provider in the default Weather module was fixed in MM
v2.33.0 to use a new URL hierarchy that Environment Canada implemented
to access weather data for Canadian locations. Subsequent to this
provider update, Environment Canada has implemented one further update
to their URL hierarchy to make it easier to access 'current day' weather
data. Tis change was raised in Issue #3912 as a Bug, which is addressed
in this Provider update. There are no Magic Mirror UI changes from this
update.

The fix is to add one additional element to the URL used to access
Environment Canada XML-based weather data.

This PR is also taking the opportunity to make one further small fix to
how windspeed is handled in this Provider. Most of the time, Env Canada
provides an expected numeric value. There are instances, however, where
the value provided is 'calm', which the Weather module does not expect.
The Provider code has been changed to detect a 'calm' windspeed and
convert it to '0' for the purposes of the Weather module. Note that in
the world of weather/climate analysis, a windspeed of 'calm' is used as
a synonym for a windspeed of 0.

Note that a ChangeLog entry is included in this PR.
2025-10-19 19:06:44 +02:00
Kristjan ESPERANTO
96d3e8776d [weather] feat: add configurable forecast date format option (#3918)
I was a little disappointed that I couldn't change the date format in
the forecast because it was hard-coded. This PR introduces a new option
(`forecastDateFormat`) that allows the user to specify the format
themselves. The default remains `ddd`.

## Before

<img width="483" height="524" alt="Screenshot From 2025-10-18 18-26-13"
src="https://github.com/user-attachments/assets/2de6af55-e73c-42e8-a3fe-7386ef5f90e0"
/>

## After (examples)

### `forecastDateFormat: "dddd"`
<img width="483" height="524" alt="Screenshot From 2025-10-18 18-26-27"
src="https://github.com/user-attachments/assets/cd86c798-f1e4-4d75-adf9-c4e549aa2a51"
/>

### `forecastDateFormat: "ddd, D MMM"`
<img width="483" height="524" alt="Screenshot From 2025-10-18 18-28-02"
src="https://github.com/user-attachments/assets/79aaa7b3-810a-4ab1-833c-09dfab7f457a"
/>
2025-10-18 19:57:41 +02:00
Karsten Hassel
d39e686f7a remove eslint warnings, add npm publish process to Collaboration.md (#3913) 2025-10-14 22:44:37 +02:00
Kristjan ESPERANTO
787cc6bd1f refactor: replace module-alias dependency with internal alias resolver (#3893)
- removes the external unmaintained `module-alias` dependency ->
reducing complexity and risk
- introduces a small internal alias mechanism for `logger` and
`node_helper`
- preserves backward compatibility for existing 3rd‑party modules
- should simplify a future ESM migration of MagicMirror

I'm confident that it shouldn't cause any problems, but we could also
consider including it in the release after next. What do you think?

This PR is inspired by PR #2934 - so thanks to @thesebas! 🙇 😃
2025-09-30 20:12:58 +02:00
Karsten Hassel
1f2d1b92b5 update jsdoc and other deps (#3896)
other cosmetic code changes because of new `eslint-plugin-jsdoc` version
v60
2025-09-23 06:27:29 +02:00
Veeck
fbca0a0e55 [layout] update styles for weather and calendar (#3894) 2025-09-17 20:02:14 +02:00
Kevin G.
e8868217a9 Fix for envcanada Provider to use new Environment Canada weather data access (#3878)
Earlier in 2025, Environment Canada changed the process to access
weather data for Canadian cities. This change was raised in Issue #3822
as a Bug, which is addressed in this Provider update. There are no Magic
Mirror UI changes from this update.

The 'old' method to access Environment Canada involved accessing a
static URL based on a City identifier which would result in an XML
document containing the appropriate weather data.

The 'new' method is a 2 step process. The first step is to access a
time-sensitive URL that contains a list of links to various cities that
have weather data available. The second step requires finding the
correct city in that list based on a City identifier, and then accessing
that unique URL to access an XML document containing the appropriate
weather data.

The changes made to the envcanada Provider code are solely aimed at
using the new 2-step method to access a specified City's weather data.
Since the resulting XML document structure has not changed, no other
code in envcanada required changes.

Note that a ChangeLog entry is included in this PR.

---------

Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
Co-authored-by: veeck <gitkraken@veeck.de>
2025-09-17 12:07:32 +02:00
Veeck
a49fbede18 [weather] better null value handling for weather type (#3892)
As mentioned
[here](https://github.com/MagicMirrorOrg/MagicMirror/pull/3878#issuecomment-3275344406)
our weather module needs a bit better handling for null values in the
type field.

This pr adds this and cleans up the layout a little.
2025-09-16 17:00:02 +02:00
Veeck
08d29c3083 Add Prettier plugin for Nunjuck templates (#3887) 2025-09-11 13:10:53 +02:00
Karsten Hassel
b1865d8115 refactor: use global.root_path instead relative paths (#3883) 2025-09-09 08:09:45 +02:00
Veeck
31bafc3297 update default icon for calendars (#3879)
While looking at
https://github.com/MagicMirrorOrg/MagicMirror-Documentation/issues/114 I
noticed that the default icon is not named correctly.

`calendar-alt` should be called `calendar-days` which seems to be its
fallback anyways.

I also updated the link to the icon search

---------

Co-authored-by: veeck <gitkraken@veeck.de>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
2025-09-08 14:42:13 +02:00
Veeck
25efe4204f Update feels_like temperature formula (#3869)
The current logic never showed any different temperature than the
current one, so I looked into a more "explained" formula and found one
in the HomeAssistant forums.
2025-09-01 15:12:52 +02:00
Veeck
f8679b6ba8 [weather] use 'apparent_temperature' in openmeteos data for feelsLike temperature (#3868) 2025-08-30 13:00:00 +02:00
sam detweiler
3387bf8db0 fix regression #3841 (#3865)
fixes #3841

this is a correction of the rewrite
2025-08-28 16:50:12 +02:00
sam detweiler
483d3cd4e6 Fix limitdays regression (#3863)
fixes #3840 

this is a rewrite

---------

Co-authored-by: veeck <gitkraken@veeck.de>
2025-08-28 16:13:29 +02:00
Marcel
76da0aa55e Make User-Agent configurable (#3255)
Fixes #3253 

Adds a configuration option to overwrite the default `User-Agent` header
that is send at least by the calendar and news module. Allows other
modules to use the individual user agent as well.

The configuration accepts either a string or a function:
```
var config =
	{
		...
		userAgent: 'Mozilla/5.0 (My User Agent)',
		...
	}
```
or
```
var config =
	{
		...
		userAgent: () => 'Mozilla/5.0 (My User Agent)',
		...
	}
```

---------

Co-authored-by: Veeck <github@veeck.de>
Co-authored-by: veeck <gitkraken@veeck.de>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
2025-08-27 13:50:37 +02:00
Veeck
1b31cf19e9 Thoroughly check for precipitationAmount values in weathergov provider (#3859)
Fixes #3856

---------

Co-authored-by: veeck <gitkraken@veeck.de>
2025-08-16 20:56:52 +02:00
Veeck
839d074df1 Update dependencies (#3857)
Just some normal maintainance after the holidays

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: veeck <gitkraken@veeck.de>
2025-08-11 12:49:03 +02:00
Karsten Hassel
3fa2b96054 cleanup and try to stabilize weather e2e tests (#3848)
The weather e2e tests are failing sometimes, failing is not really
reproducable.

After changing `updateDom(0)` to `updateDom(300)` in `weather.js` it
seems to work (we will se if it really works in the long term).

This PR contains some other weather e2e changes/cleanups/simplifying.
2025-07-20 08:23:52 +02:00
Karsten Hassel
54752f10e8 replace console with Log in calendar debug.js (#3846)
to avoid exception in eslint config.

Background: If someone has a copy of the `modules` folder in his setup
eslint fails because the file `debug.js` uses `console` statements. I
need the `modules` folder renamed in my docker setup so this test always
fails. I think this is a simple solution which has no impact.
2025-07-16 00:38:03 +02:00
Karsten Hassel
a05eb23306 refactor default modules: move scheduleTimer to one place (#3837)
see #3819

---------

Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
Co-authored-by: Veeck <github@veeck.de>
2025-07-10 08:12:09 +02:00
Veeck
e4ec8c3589 Fix missing icons in clock module (#3834)
Fixes #3818

---------

Co-authored-by: veeck <gitkraken@veeck.de>
2025-07-05 22:47:38 +02:00
dathbe
3a2a52c864 Add CSS to clock module to prevent line breaking of sunrise/sunset information (#3816)
1. Base your pull requests against the `develop` branch.
Done
2. Include these infos in the description:
- Does the pull request solve a **related** issue?
No
- If so, can you reference the issue like this `Fixes #<issue_number>`?
N/A
- What does the pull request accomplish? Use a list if needed.
With some combinations of sunrise and sunset times (usually when the
time till rise/set is >9:59), the information will break across multiple
lines. This prevents that by adding CSS.
- If it includes major visual changes please add screenshots.
I don't consider it major.
3. Please run `npm run lint:prettier` before submitting so that style
issues are fixed.
Done
4. Don't forget to add an entry about your changes to the CHANGELOG.md
file.
Done

---------

Co-authored-by: veeck <gitkraken@veeck.de>
2025-07-02 19:20:03 +02:00
Karsten Hassel
1e11d28224 fixes e2e tests (#3817)
- fix newsfeed and calendar e2e tests so they don't need `--forceExit`
anymore
- `--forceExit` should stay in test runs to avoid running until test
limit in case of errors
- remove mocking console, not needed anymore
- configFactory-stuff should not run in browser (otherwise we get errors
`[ReferenceError: exports is not defined]`)
2025-06-25 08:27:52 +02:00
Koen Konst
faf15ad211 Refactored calendarfetcherutils to fix many of the timezone and DST related issues and make debugging way easier (#3806)
Refactored calendarfetcherutils to remove as many of the date
conversions as possible and use moment tz when calculating recurring
events, this will make debugging a lot easier and fixes problems from
the past with offsets and DST not being handled properly. Also added
some tests to test the behavior of the refactored methodes to make sure
the correct event dates are returned.

Refactored calendar.js aswell to make sure the unix UTC start and end
date of events are properly converted to a local timezone and displayed
correctly for the user.

This PR relates to:
https://github.com/MagicMirrorOrg/MagicMirror/issues/3797

---------

Co-authored-by: Koen Konst <c.h.konst@avisi.nl>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
2025-06-07 14:13:01 +02:00
BugHaver
2f9f4b6253 [feature] implement short syntax for clock week (#3775)
Hello and thank you for wanting to contribute to the MagicMirror²
project!

**Please make sure that you have followed these 4 rules before
submitting your Pull Request:**

> 1. Base your pull requests against the `develop` branch.
> 2. Include these infos in the description: implement short syntax for
clock week
>
> - Does the pull request solve a **related** issue? n/a
> - If so, can you reference the issue like this `Fixes
#<issue_number>`?
> - What does the pull request accomplish? Use a list if needed.
> - If it includes major visual changes please add screenshots.
>
> 3. Please run `npm run lint:prettier` before submitting so that
>    style issues are fixed.
> 4. Don't forget to add an entry about your changes to
>    the CHANGELOG.md file.


![image](https://github.com/user-attachments/assets/e6c16981-de0a-45be-b553-7a7a67977d55)


![image](https://github.com/user-attachments/assets/ebae32e7-e6fb-41aa-971a-908880acc7b9)


**Note**: Sometimes the development moves very fast. It is highly
recommended that you update your branch of `develop` before creating a
pull request to send us your changes. This makes everyone's lives
easier (including yours) and helps us out on the development team.

Thanks again and have a nice day!

---------

Co-authored-by: BugHaver <43462320+lsaadeh@users.noreply.github.com>
2025-05-16 08:04:18 +02:00
Kristjan ESPERANTO
965e935881 [linter] Review linter setup (#3783)
- [2b395b9f] Fix command to lint markdown in `CONTRIBUTING.md`
- [fed4c86c] Re-activate JSDoc ESLint plugin and fix linting issues (As
far as I remember, we deactivated it when we upgraded to ESLint 9
because it was not compatible with it. But its now.)
- [a3d2064b] Refactor ESLint config to use `defineConfig` and
`globalIgnores` ([these are like new
defaults](https://eslint.org/blog/2025/03/flat-config-extends-define-config-global-ignores/))
- [a3d2064b] Replace `eslint-plugin-import` with
`eslint-plugin-import-x`
(https://github.com/es-tooling/module-replacements/blob/main/docs/modules/eslint-plugin-import.md)
- [86a185b6] Switch Stylelint config to flat format and simplify
Stylelint scripts (like we already did for ESLint and prettier)
  - [f5a2c541] Fix some typos
2025-05-12 23:40:05 +02:00
sam detweiler
2422e847b1 Fix calendar rrule until where event is fullday but rrule until has a non-0 time (#3782)
This fixes #3781 

tests supplied

see
https://forum.magicmirror.builders/topic/19637/issue-with-outlook-recurring-events
2025-05-12 23:39:36 +02:00
Kristjan ESPERANTO
b9d63d7252 Use "node --run" instead of "npm run" (#3764)
This has the advantage that the package manager is no longer involved
after the installation process.

However, previous start commands such as `npm run start` continue to
work. So we don't even have to adapt the documentation.
2025-05-06 20:33:42 +02:00
BugHaver
ff6682982f [feature] Introduce disableNextEvent to hide next sun event (#3769)
Hello and thank you for wanting to contribute to the MagicMirror²
project!

**Please make sure that you have followed these 4 rules before
submitting your Pull Request:**

> 1. Base your pull requests against the `develop` branch.
> 2. Include these infos in the description:
>
> - Does the pull request solve a **related** issue? No
> - If so, can you reference the issue like this `Fixes
#<issue_number>`? N/A
> - What does the pull request accomplish? Use a list if needed.
Introduce showNextEvent to show/hide next sun event
> - If it includes major visual changes please add screenshots.
>
![image](https://github.com/user-attachments/assets/410f6a82-e4fe-4c40-a477-8249149febf3)
> 3. Please run `npm run lint:prettier` before submitting so that
>    style issues are fixed.
> 4. Don't forget to add an entry about your changes to
>    the CHANGELOG.md file.

**Note**: Sometimes the development moves very fast. It is highly
recommended that you update your branch of `develop` before creating a
pull request to send us your changes. This makes everyone's lives
easier (including yours) and helps us out on the development team.

Thanks again and have a nice day!

---------

Co-authored-by: BugHaver <43462320+lsaadeh@users.noreply.github.com>
2025-04-27 18:37:17 +02:00
Karsten Hassel
e546fedeb1 updatenotification: add param to get modules from modules-dir instead… (#3755)
… from config

implements #3739
2025-03-31 17:57:42 +02:00
OWL4C
6d909d24e9 [weather] add humidity to hourly view, fix spacing error when using UV Index, add config option to hide precipitation entries that are zero [Rebased Version of PR #3526] (#3748)
Fixed Version of PR #3526 since that was against the wrong branch and
had issues.

Original PR Text: 
Basically the title. Just some existing weather data included into
hourly, some config option ("hideZeroes") to hide precipitation when it
is zero (this actually shrinks the entire table, removing columns that
are completely empty), and add a spacing column to fix the UV Index
column.

---------

Co-authored-by: Veeck <github@veeck.de>
2025-03-27 21:23:17 +01:00
Karsten Hassel
0cfe2730ea newsfeed: add specific ignoreOlderThan value (override) per feed (#3742)
fixes #3360 

superseeds https://github.com/MagicMirrorOrg/MagicMirror/pull/3429

had to open a new PR because getting `permission denied` when trying to
push to the old one.
2025-03-18 10:19:05 +01:00
sam detweiler
51d11bf26c add support for digital clock time color (#3737)
see
https://forum.magicmirror.builders/topic/19440/digital-clock-minutes-darker

changelog added

question.. 

we have a config parm for seconds color, but not hour/minute
I have used css here.. is that too inconsistent?

---------

Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
Co-authored-by: Veeck <github@veeck.de>
2025-03-16 15:33:27 +01:00
mixasgr
0afc1ed58d Updated Greek Translations (#3741)
Hello,

we have updated the core Greek translation and added Greek translation
to Alerts module.

Thank you!

---------

Co-authored-by: Savvas Adamtziloglou <savvas-gr@greeklug.gr>
Co-authored-by: Konstantinos <geraki@gmail.com>
Co-authored-by: Veeck <github@veeck.de>
2025-03-15 21:54:20 +01:00
Kristjan ESPERANTO
2adf341fef Add Esperanto translation (#3740)
I've had this on my agenda for a long time 🙂
2025-03-13 13:02:02 +01:00