5030 Commits

Author SHA1 Message Date
Karsten Hassel
d84d612df5 Release 2.29.0 2024-09-30 23:49:05 +02:00
Karsten Hassel
719eca49fe
update dependencies, nail down node-ical version to 0.18.0 (#3566)
- node-ical use `0.18.0` instead of `^0.18.0` in `package.json`
- cleanup `package-lock.json`
2024-09-28 15:33:53 -05:00
sam detweiler
d9eefff066
fix double load of positions now that check:config at startup is active (#3565)
after adding check:config to the MM startup process, #3450, we
accidentally discover module positions more than once, and write the
file each time..

add a check to see if we have done this work already
2024-09-28 15:52:09 +02:00
Bugsounet - Cédric
731512c2e5
Electron rebuild tests update (#3563)
# Update electron-rebuild.yaml
* remove onoff library: Not updated since 3 years, don't work with last
rpi Os
 * add node-libgpiod library in replacement
2024-09-26 19:09:39 +02:00
Bugsounet - Cédric
ebaeed935f
Engine except on node v21 (#3561)
in addition of #3559 

except with node v21: no security updates and EOL
2024-09-26 19:09:10 +02:00
Marc Landis
2e6e86887b
fix calendar showing previous day when using sliceMultiDayEvents (#3555)
This bug is caused by #3543.

The calculation for midnight adds a day but for endDate we want the day
to be subtracted again.
2024-09-25 21:16:43 +02:00
Kristjan ESPERANTO
d3187689f0
Switch to ESLint v9 and flat config (#3558)
Since PR #3551 was not yet complete, I made my own attempt.

1. Update to ESLint v9.
2. Replace deprecated `.eslintrc.json` and `.eslintignore` by flat
config `eslint.config.mjs`.
3. Adapt `check_config.js` to use flat config.
4. Since `eslint-plugin-import` still doesn't support ESLint v9 I
removed it. We can add it back when it does support v9.
5. Run tests `npm run check:js` and `npm run config:check`.
6. In order not to overload this PR, I have not yet activated more
additional rules - there are some useful ones in the new plugin
`@eslint/js`.

@bugsounet, please don't take it as an offence that I have created a
competing PR. The migration to ESLint v9 has been burning under my nails
for some time.
2024-09-25 21:05:11 +02:00
Bugsounet - Cédric
5ffdf9af09
Updated minimal needed node version in package.json (currently v20.9.0) (#3559)
Update of package*.json for minimal node verion requirement (v20.9.0)

 * it's an addition to #3556
* According to changelog v2.28.0: `⚠️ This release needs nodejs version
>= v20.9.0`
2024-09-25 09:03:09 +02:00
Karsten Hassel
08116b8e64
fixes for running tests for MM_MODULES_DIR (#3550)
and ignore `js/positions.js` when linting (because this file is
generated at runtime).
2024-09-24 22:38:00 +02:00
Karsten Hassel
fa6a7521b4
add tests for minimal node version (currently v20.9.0) (#3556)
Beside testing against node version `v20.x` and `v22.x` we should also
test against the minimal node version, currently `v20.9.0`.

This is for seeing changes in dependencies which needs higher node
version as with the July-24-release, where we wrote `node >=20` but
shipped an `eslint` version which required `node>=20.9.0`.
2024-09-24 22:09:28 +02:00
Veeck
06a8b517aa
Cleanup github actions (#3549)
- should now correct itself when one changes from (accidentaly selected)
master to develop
- also fixes wrong CHANGELOG entry from
https://github.com/MagicMirrorOrg/MagicMirror/pull/3481
- update deps a little
2024-09-19 12:25:41 +02:00
Ryan Williams
1823f5a130
Updated to new notification name DOM_OBJECTS_UPDATED -> MODULE_DOM_UPDATED (#3548)
This is an update to #3535. See #3534 for discussion and context. Fixes
#3534 (again).
2024-09-19 07:29:43 +02:00
Karsten Hassel
8f5aa50d79
added test for MM_MODULES_DIR (#3546)
uses newsfeed test after copying this module to config dir

addition for #3530
2024-09-19 07:29:04 +02:00
Karsten Hassel
65d7e2d067 fix CHANGELOG.md 2024-09-18 21:53:18 +02:00
Kristjan ESPERANTO
06f6fbf49b
Review config_check.js (#3545)
Only details changes. No functional changes.

- remove superfluous colors in Log.error
- invert negative if
- update ESLint env
- use camel case variable name
- optimize Log strings
2024-09-18 21:39:02 +02:00
Ryan Williams
c6e05c9fec
Added DOM_OBJECTS_UPDATED notification when the DOM is re-rendered via updateDom (#3535)
- [x] Base your pull requests against the `develop` branch.
- [x] Include these infos in the description:
> - Does the pull request solve a **related** issue?
Yes - solves #3534

> - If so, can you reference the issue like this `Fixes
#<issue_number>`?
Fixes #3534 (also mentioned in commit message)

> - What does the pull request accomplish? Use a list if needed.

> > - Adds a new notification (`DOM_OBJECTS_UPDATED`) when the DOM is
updated via `updateDom`

- [x] Please run `npm run lint:prettier` before submitting
- [x] Don't forget to add an entry about your changes to the
CHANGELOG.md file.

More info can be found in #3534, but as a summary:

The `updateDom` function is not synchronous - there is an undetermined
amount of time between when it completes and when the DOM has actually
been re-rendered and is ready for interaction. The existing notification
(`MODULE_DOM_CREATED`) only fires once on the initial DOM render. This
PR solves the issue of subsequent re-renders by adding a new
notification that fires whenever the DOM is ready after an update. This
notification falls within expected lifecycle notifications (very similar
to other libraries that provide DOM lifecycle notifications).
2024-09-18 19:40:46 +02:00
Kristjan ESPERANTO
866419eb95
Check config before starting MM (#3450)
I think it might be a good idea to check the config at every start.
2024-09-18 19:37:25 +02:00
Karsten Hassel
659e0c74cb
add new env vars MM_MODULES_DIR and MM_CUSTOMCSS_FILE … (#3530)
… for setting these things from outside (and overriding corresponding
config.js properties `config.foreignModulesDir` and `customCss`)

- remove elements from index.html when loading script or stylesheet
files fails
- removed `config.paths.vendor` (could never work because `vendor` is
hardcoded in `index.html`) and renamed `config.paths.modules` to
`config.foreignModulesDir`. The `config.paths. ...` properties were
implemented in the initial commit in `js/defaults.js` but were never
functional.
- fixes `app.js` which didn't respect `config.paths.modules` before
- as `modules/defaults` is directly set in many places in the source
code restrict `config.paths.modules` to foreign modules (it has never
worked for default modules), now renamed to `config.foreignModulesDir`
- adds new `/env` section in `server.js` for getting the new env vars in
the browser
- fixes TODO in `server.js` so test directories are now only published
when running tests

These changes allow changing some main paths from outside mm with the
new env vars. You now **can** put all user stuff into one directory,
e.g. the `config` dir:
- `config.js` as before
- `custom.css`
- foreign modules

This would simplify other setups e.g. the docker setup. At the moment we
have to deal with 3 directories where 2 of them (`modules` and `css`)
contains mixed stuff, which means mm owned files and user files. This
can now simplified and leads to cleaner setups (if wanted).
2024-09-18 19:10:46 +02:00
Kristjan ESPERANTO
d9f9f41e98
Add spell check (#3544)
I felt like adding a spell checker, but it's okay if you find it
superfluous. At least then we could fix the found spell issues.

What is still missing is an automatic integration so that the spell
checker does not have to be called manually. Would it perhaps make sense
to always do it before a release?
2024-09-18 07:37:09 +02:00
sam detweiler
ea3a323581
add fix for sliceMultiDayEvents (#3543)
sliceMultiDayEvents occasionally gets the number of events wrong and
produces too many rows

Math.ceil() rounds up over 1.04 so we get an abnormal count

then the calcs for the midnight loop control used different moment()
functions, producing different results

fixes #3542
2024-09-17 08:01:49 +02:00
Karsten Hassel
0faefd109a
fixes calendar test by moving it from e2e to electron with fixed date (#3540)
and refactor tests/electron/modules/calendar_spec.js

fixes #3532
2024-09-15 08:36:11 +02:00
Karsten Hassel
81351fb4cc
update dependencies (#3536) 2024-09-14 22:05:20 +02:00
Karsten Hassel
3380314c11
hotfix for calendar_spec.js (used data now returns 20 events) (#3533)
fixes #3532
2024-09-13 16:52:34 -05:00
Kristjan ESPERANTO
bca5d9c845
Ignore positions.js (#3531)
This file is generated when MM is started. As I understand it, it should
not be included in the repository.

Should probably have been part of #3518.
2024-09-11 23:12:34 +02:00
Karsten Hassel
7915de3149
update dependencies (#3527)
We cannot upgrade to electron v32 because electron-rebuild is failing
with epoll, so staying at v31.
2024-08-31 07:14:30 +02:00
sam detweiler
2b97e0d26e
add support for custom regions, by detecting what is used in index.html (#3518)
read index.html to discover the regions used, make them the list checked
by app.js and check:config test

fixes #3504   supercedes #3506 

no config.js param required
2024-08-27 22:52:59 +02:00
Panagiotis Skias
56736786fd
Bug in Weather Units for Broadcasted Notification (#3519)
This PR resolve Issue number #3419 .

I have added the method `convertWeatherObjectToImperial()` which
converts the units of the `notificationPayload` to imperial if needed,
in order to pass the object in `sendNotification()`.

---------

Co-authored-by: veeck <michael.veeck@nebenan.de>
2024-08-18 10:04:51 +02:00
Ryan Williams
cc1d4ab240
Improve duplicate module filtering. Update SocketIO catch-all API. (#3523)
- [x] Base your pull requests against the `develop` branch.
- [x] Include these infos in the description:
> - Does the pull request solve a **related** issue?
Yes - solves #3521

> - If so, can you reference the issue like this `Fixes
#<issue_number>`?
Fixes #3521 (also mentioned in commit message)

> - What does the pull request accomplish? Use a list if needed.

> > - Updates duplicate module filter method (upstream vs downstream -
see #3502)
> > - Updates socket io catchall functionality to new API
[[docs](https://socket.io/docs/v4/listening-to-events/)].

- [x] Please run `npm run lint:prettier` before submitting
- [x] Don't forget to add an entry about your changes to the
CHANGELOG.md file.
2024-08-18 09:25:01 +02:00
Veeck
976c8ae00a
Bump stylistic-eslint (#3520)
updates plugin and adjust docs and config for smooth cleaning :-D

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 22:52:43 +02:00
sam detweiler
780e4e2e06
Fix loading of multiple instances of node_helper when multiple instances of a module are in config.js (#3517)
adds a check for already loaded/loading for node helper of a each
module, only does once

fixes #3502
2024-08-04 21:28:20 +02:00
Karsten Hassel
76d8f98969
allow custom module positions by setting allowCustomModulePositions… (#3506)
… in `config.js`

fixes #3504, related to
https://github.com/MagicMirrorOrg/MagicMirror/pull/3445
2024-08-01 21:24:16 +02:00
Veeck
4182c2129f
Update dependencies (#3515)
its the start of the month so dependabot is waking up :-)
2024-08-01 19:00:36 +02:00
Karsten Hassel
d22d0e1f87
remove raspberry object from systeminformation (#3507)
fixes #3505
2024-07-29 12:22:59 +02:00
sam detweiler
d9665b35df
Update compliments with support for cron type date/time for selections, addition to just date. (#3481)
> - What does the pull request accomplish? Use a list if needed.

this change allows uses to configure date/time events for compliments..
also linked site that will build the cron entry..

and example was Happy hour in a pub, on fri/sat between 5 and 7 pm. 

or just after midnight on Halloween (Boooooo!)

I also added testcases for #3478 

(and added support for this in MMM-Config), with a custom, drop down
selection list of the types.. )

|  if this is approved I will update the module doc
2024-07-15 19:51:05 +02:00
Daniel
974a1da9f0
[weather] update provider openweathermap to new apiVersion (#3496)
Co-authored-by: Karsten Hassel <hassel@gmx.de>
2024-07-11 13:37:44 +02:00
jargordon
4d14f4a2c1
Fixes the UK Met Office Datahub provider (#3499)
Fixes #3384

Changed the UKMetOfficeDataHub provider to the new API structure as per
the documentation.

API Base URL updated.
Header information amended to the correct key name.
API Secret no longer required so removed.

Changelog updated to reflect the change.
2024-07-07 16:36:59 -05:00
Karsten Hassel
3b22622054
fixes checks badge in README.md (#3494)
old url: 

![grafik](https://github.com/MagicMirrorOrg/MagicMirror/assets/25914086/025597f2-c1f1-4879-a76c-5a20c7b7099e)


new url:

![grafik](https://github.com/MagicMirrorOrg/MagicMirror/assets/25914086/f3b8850e-3fe4-4cb0-aa07-7525eb8f82eb)
2024-07-04 22:47:21 +02:00
sam detweiler
160d95ac34
Cleanup folders for #3492 (#3493)
remove installer only files. into installer

addresses #3492
2024-07-02 00:09:50 +02:00
Karsten Hassel
f7369a7e85 Prepare v2.29.0-develop 2024-06-30 23:53:28 +02:00
Karsten Hassel
7389a33f80 Merge remote-tracking branch 'origin/master' into develop 2024-06-30 23:50:35 +02:00
Karsten Hassel
53fc814ff8
Release 2.28.0 (#3490)
## [2.28.0] - 2024-07-01

Thanks to: @btoconnor, @bugsounet, @JasonStieber, @khassel,
@kleinmantara and @WallysWellies.

> ⚠️ This release needs nodejs version >= v20

### Added

- [calendar] Added config option "showEndsOnlyWithDuration" for default
calendar
- [compliments] Added `specialDayUnique` config option, defaults to
`false` (#3465)
- [weather] Provider weathergov: Use `precipitationLast3Hours` if
`precipitationLastHour` is `null` (#3124)

### Removed

- [tests] delete node v18 support (#3462)

### Updated

- [core] Update dependencies including electron to v31
- [core] use node >= v20 (#3462)
- [core] Update `config.js.sample` to use openmeteo as weather provider
which needs no api key
- [tests] Use latest@version of node for `automated-tests.yaml` (#3483)
- [updatenotification] Avoid using pm2 when running in docker container

### Fixed

- [core] Fixed crash possibility if `module: <name>` is not defined and
on `postion: <positon>` mistake (#3445)
- [weather] Fixed precipitationProbability in forecast for provider
openmeteo (#3446)
- [weather] Fixed type=daily for provider openmeteo having no data when
running after 23:00 (#3449)
- [weather] Fixed type=daily for provider openmeteo showing nightly
icons in forecast when current time is "nightly" (#3458)
- [weather] Fixed forecast and hourly weather for provider openmeteo to
use real temperatures, not apparent temperatures (#3466)
- [tests] Fixed e2e tests running in docker container which needs
`address: "0.0.0.0"` (#3479)

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Michael Teeuw <michael@xonaymedia.nl>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Ross Younger <crazyscot@gmail.com>
Co-authored-by: Veeck <github@veeck.de>
Co-authored-by: Bugsounet - Cédric <github@bugsounet.fr>
Co-authored-by: jkriegshauser <joshuakr@nvidia.com>
Co-authored-by: illimarkangur <116028111+illimarkangur@users.noreply.github.com>
Co-authored-by: sam detweiler <sdetweil@gmail.com>
Co-authored-by: vppencilsharpener <tim.pray@gmail.com>
Co-authored-by: veeck <michael.veeck@nebenan.de>
Co-authored-by: Paranoid93 <6515818+Paranoid93@users.noreply.github.com>
Co-authored-by: Brian O'Connor <btoconnor@users.noreply.github.com>
Co-authored-by: WallysWellies <59727507+WallysWellies@users.noreply.github.com>
Co-authored-by: Jason Stieber <jrstieber@gmail.com>
v2.28.0
2024-06-30 23:44:21 +02:00
Karsten Hassel
795e5c76c1 Release 2.28.0 2024-06-30 23:25:27 +02:00
Karsten Hassel
92ac3895a7
updatenotification: avoid using pm2 when running in docker container (#3484)
related to #3480 

Change module updatenotification so that it can work without `pm2` in a
docker container.

It now tests if file `/.dockerenv` exists and if so `require("pm2")` is
never called.
2024-06-28 22:33:21 +02:00
Jason Stieber
c89c3edf97
Fix weathergov api precipitationLastHour (#3125)
Pull request fixes small big in weathergov api format mismatch #3124

---------

Co-authored-by: Karsten Hassel <hassel@gmx.de>
2024-06-28 22:21:38 +02:00
Karsten Hassel
74c6bb30b0
Update dependencies (#3487)
and minor fixes in changelog.
2024-06-28 22:09:44 +02:00
Bugsounet - Cédric
cfc0bc617f
Update CHANGELOG.md (#3486)
Adjust my own ChangeLog entry
2024-06-27 21:37:22 +02:00
Karsten Hassel
4aafa32875
fixes e2e tests running in docker container (#3485)
which needs `address: "0.0.0.0"`

fixes #3479
2024-06-27 10:38:29 +02:00
Bugsounet - Cédric
f28b4bd709
Use latest@version of node for automated-tests.yaml (#3483)
Maybe it's a good idea to use latest@node version for automated-tests

Actually it's an "random" version

Note: it's already used [there in
electronRebuild](https://github.com/MagicMirrorOrg/MagicMirror/blob/develop/.github/workflows/electronRebuild.yaml#L19)
2024-06-26 21:43:41 +02:00
WallysWellies
aefb3a0b6d
Update compliments module (#3471)
`Fixes #3465`

Add config option `specialDayUnique` that defaults to `false` and causes
special day compliments to be added to the existing compliments array.
Setting this option to `true` will only show the compliments that have
been configured for that day.

---------

Co-authored-by: Veeck <github@veeck.de>
Co-authored-by: veeck <michael.veeck@nebenan.de>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
2024-06-24 22:40:59 +02:00
Brian O'Connor
3d9d72e64e
Open-Meteo: Fix forecast and hourly weather to use real temperatures, not apparent temperatures (#3468)
As discussed in #3466, the Open-Meteo provider is using the apparent
temperature ("Feels like") in the forecast and hourly weather reporting.
This is contrary to expected behavior.

Note: I'm a little unclear on how I should be editing the `CHANGELOG.md`
file with this PR - happy to update this PR with a little guidance. This
is my first attempted PR in this project.

Let me know if there are any questions.

---------

Co-authored-by: veeck <michael.veeck@nebenan.de>
2024-06-24 22:18:49 +02:00