4919 Commits

Author SHA1 Message Date
Karsten Hassel
b7371538bc
update deps and remove stylelint fix (#3120)
~~there are no "all" files in the v5 versions of roboto-fonts anymore so
I used the content of their css files in `roboto.css`~~

coming with separate PR
2023-06-08 22:40:23 +02:00
Karsten Hassel
a56b92990d
update deps incl. electron to v25, fix stylelint segmentation dump (#3118)
- update electron to v25
- added `overrides:` section to `package.json` to fix
https://github.com/stylelint/stylelint/issues/6898 (must be removed when
fixed upstream, fixing the version to `v15.6.2` did not fix the problem)
- update other deps
2023-06-06 10:16:24 +02:00
Veeck
c7405b76b3
Split install and run commands in github actions (#3112)
... makes looking at the checks a little easier in case they fail

---------

Co-authored-by: veeck <michael@veeck.de>
2023-05-27 22:22:26 +02:00
OWL4C
eceec8285d
Adding experimental UV Index support for weather module (#3108)
This pr adds (config.js toggleable) showUV_Index to the hourly and
current weather modules, with right now only openmeteo configured to
supply the data. Other providers could have support too by adding
`uv_index` to current and hourly.

For example the current weather looks like
![image](https://github.com/MichMich/MagicMirror/assets/124401812/00fdf5db-c0d5-4797-9a31-1d72dd970d26)
positioned after sunset in the top row.



The following "hacks" are included and could be fixed to make it
cleaner, but the functionality is wanted and it works without problem.
- To hide entries where the UV Index is 0 i added an if statement to the
`hourly.njk` which is not how precipitation is handled.
The following are minor things that might not need fixing:
- The forecast option does not have UV support. This might not be
relevant since UV changes throughout the day but i tried to implement a
"max_UV" to openmeteo.js, but am not confident enough in JS to
accomplish that.
- The UV Icon is wi-hot and manually added to the `.njk`'s. This could
be made changeable by a config but does not seem relevant since wi-hot
is not used by anything else as far as i can tell.

---------

Co-authored-by: veeck <michael@veeck.de>
2023-05-22 10:57:48 +02:00
Eddie Hung
0573d6e772
Fix envcanada today pop (#3106)
Fix for today's probability-of-precipitation weather module's envcanada
provider.

Without which, requesting `showPrecipitationProbability` causes
"undefined" to be shown.

Consistent with method used elsewhere in the file:

abe5c08a52/modules/default/weather/providers/envcanada.js (L395-L399)
2023-05-21 10:51:13 +02:00
Jørgen Veum-Wahlberg
babd22b04f
Bug fix: adding date to the analog clock if showDate is true (#3101)
Adding date to the clock module when displayType is "analog" and
"showDate" is true. The setting in analogShowDate is respected.

Fixes #3100

---------

Co-authored-by: Michael Teeuw <michael@xonaymedia.nl>
Co-authored-by: Veeck <github@veeck.de>
2023-05-19 14:52:59 +02:00
Veeck
432d900ecd
Add tests for some weather utils (#3103)
Co-authored-by: veeck <michael@veeck.de>
2023-05-15 21:04:50 +02:00
Ismar Slomic
83315f1fed
fix: don't filter out ongoing full day events in Calendar module (#3095) (#3096)
Fixes #3095.

Param `hideOngoing` is by default set to `false`, but the event
filtering handles `full day` & `non-full day` events inconsistently. For
`non-full day` _ongoing_ and _upcoming_ events are returned, while for
`full day` only _upcoming_ events where returned.
2023-05-15 20:16:33 +02:00
Oscar Björkman
e09d60d1d1
Use single config backup file when config.template is used (#3104)
Copy `config.js` to a single `config.js-old` file whenever a
`config.template` is present, instead of using `Date()` as a suffix.
Creating files with a timestamp suffix means that whenever Magic Mirror
is restarted or recreated a new file is written into the config
directory.

Benefits:
* Single backup file will avoid excessive writing of files
* Saves space and usage on SD cards.
* Makes the folder cleaner and easier to overview, compared to ending up
with something like this as time goes on:

![image](https://github.com/MichMich/MagicMirror/assets/17575446/9b66a99c-e760-471e-884c-9daa19689702)
2023-05-15 20:11:23 +02:00
OWL4C
d832d795df
Add openmeteo precipitation probability (#3099)
Due to the size of the commit there is no need for a long explanation:
Openmeteo supports precipitation probability in api, but the weather
provider .js had no support for it. After adding 4 lines it works as
expected. This should have no consequences on other files but improves
usability for (imo) the best weather provider.

---------

Co-authored-by: veeck <michael@veeck.de>
2023-05-13 09:29:00 +02:00
Karsten Hassel
a41aa48dd1
add .gitattributes and fix prettier/js warnings (#3094)
see title, as discussed in
https://github.com/MichMich/MagicMirror/pull/3093
2023-04-22 09:29:51 +02:00
Karsten Hassel
b80485b52f
use node v20 in github workflow (replacing v19) (#3093)
additional:

- update deps
- suppress more unwanted log errors in e2e tests
- add .gitattributes
- fix prettier/js warnings
2023-04-22 09:29:23 +02:00
Veeck
7e58b38ddf
Add no-param-reassign from eslint (#3089)
While waiting for the easterbunny I cleaned up some bad coding practice
:-)

Very open for comments especially regarding the places I commented
myself...

---------

Co-authored-by: veeck <michael@veeck.de>
2023-04-16 17:38:39 +02:00
Karsten Hassel
979f4ec664
fix electron not running under windows (after async changes) (#3091)
fixes #3083 

tested under windows 11 and linux.
2023-04-12 08:25:07 +02:00
Veeck
4e3369062e
Fix envcanada hourly forecast time (#3090)
Fixes #3080

---------

Co-authored-by: veeck <michael@veeck.de>
2023-04-09 19:23:44 +02:00
Veeck
77f9c86774
Refactor calendar methods into util class (#3088)
Refactored some methods in calendar module:
- move methods into own file 
- dont call shorten method from titelTransform because why? just call
them after each other.
- added tests for util methods
- cleaned up other tests

---------

Co-authored-by: veeck <michael@veeck.de>
2023-04-09 12:49:50 +02:00
JakeBinney
dee3cd3da7
Fixed clock module sunrise/sunset timezone bug (#3070)
Updated sunrise/sunset times to display user-requested timezone rather
than system timezone.

Note: rebase of  #3069 against develop rather than master

Co-authored-by: Veeck <github@veeck.de>
2023-04-09 09:19:51 +02:00
Karsten Hassel
09f117c3d9
set Timezone Europe/Berlin in unit tests (#3087)
needed for new formatTime unit tests.

Avoiding ugly TZ setting in github workflows, see
https://github.com/MichMich/MagicMirror/pull/3073
2023-04-08 08:55:43 +02:00
Veeck
32192d1698
Refactor formatTime into util class (#3073)
While looking at https://github.com/MichMich/MagicMirror/pull/3070 I
noticed that the weather and clock module do some formatTime stuff, so
why not use a common function for that?

---------

Co-authored-by: veeck <michael@veeck.de>
2023-04-07 23:11:54 +02:00
Karsten Hassel
2c7beeaaaf
added test for serveronly (#3086)
- add test for serveronly, fixes #3076 
- use template literals in port_variable.js.template
2023-04-07 19:42:46 +02:00
Kristjan ESPERANTO
0d3ad9812c
Drop node v14 support (#3085)
node v14 will have reached end-of-life by the next release.

From April 18th we can use node v20 instead of v19 for testing.
2023-04-07 19:24:27 +02:00
Karsten Hassel
b7eb21e48f
removed unneeded (and unwanted) '.' (#3084)
after the year in calendar repeatingCountTitle (#2896, second attempt
...)
2023-04-07 14:54:19 +02:00
Karsten Hassel
9703226c73
Update electron to v24, remove th.json from root dir (#3079)
- current electron v22 has end of life 07 Jul 2023 so it has to be
upgraded before next release
- removed th.json from root dir (came back with latest release)
- updated other dependencies
2023-04-05 07:43:42 +02:00
Michael Teeuw
cc11b77f24 Prepare v2.24.0-develop 2023-04-04 20:56:49 +02:00
Michael Teeuw
abe5c08a52
Release 2.23.0 (#3078)
## [2.23.0] - 2023-04-04

Thanks to: @angeldeejay, @buxxi, @CarJem, @dariom, @DaveChild, @dWoolridge, @grenagit, @Hirschberger, @KristjanESPERANTO, @MagMar94, @naveensrinivasan, @nfogal, @psieg, @rajniszp, @retroflex, @SkySails and @tomzt.

Special thanks to @khassel, @rejas and @sdetweil for taking over most (if not all) of the work on this release as project collaborators. This version would not be there without their effort. Thank you guys! You are awesome!

### Added

- Added increments for hourly forecasts in weather module (#2996)
- Added tests for hourly weather forecast
- Added possibility to ignore MagicMirror repo in updatenotification module
- Added Pirate Weather as new weather provider (#3005)
- Added possibility to use your own templates in Alert module
- Added error message if `<modulename>.js` file is missing in module folder to get a hint in the logs (#2403)
- Added possibility to use environment variables in `config.js` (#1756)
- Added option `pastDaysCount` to default calendar module to control of how many days past events should be displayed
- Added thai language to alert module
- Added option `sendNotifications` in clock module (#3056)

### Removed

- Removed darksky weather provider
- Removed unneeded (and unwanted) '.' after the year in calendar repeatingCountTitle (#2896)

### Updated

- Use develop as target branch for dependabot
- Update issue template, contributing doc and sample config
- The weather modules clearly separates precipitation amount and probability (risk of rain/snow)
  - This requires all providers that only supports probability to change the config from `showPrecipitationAmount` to `showPrecipitationProbability`.
- Update tests for weather and calendar module
- Changed updatenotification module for MagicMirror repo only: Send only notifications for `master` if there is a tag on a newer commit
- Update dates in Calendar widgets every minute
- Cleanup jest coverage for patches
- Update `stylelint` dependencies, switch to `stylelint-config-standard` and handle `stylelint` issues, update `main.css` matching new rules
- Update Eslint config, add new rule and handle issue
- Convert lots of callbacks to async/await
- Revise require imports (#3071 and #3072)

### Fixed

- Fix wrong day labels in envcanada forecast (#2987)
- Fix for missing default class name prefix for customEvents in calendar
- Fix electron flashing white screen on startup (#1919)
- Fix weathergov provider hourly forecast (#3008)
- Fix message display with HTML code into alert module (#2828)
- Fix typo in french translation
- Yr wind direction is no longer inverted
- Fix async node_helper stopping electron start (#2487)
- The wind direction arrow now points in the direction the wind is flowing, not into the wind (#3019)
- Fix precipitation css styles and rounding value
- Fix wrong vertical alignment of calendar title column when wrapEvents is true (#3053)
- Fix empty news feed stopping the reload forever
- Fix e2e tests (failed after async changes) by running calendar and newsfeed tests last
- Lint: Use template literals instead of string concatenation
- Fix default alert module to render HTML for title and message
- Fix Open-Meteo wind speed units
v2.23.0
2023-04-04 20:44:32 +02:00
Michael Teeuw
c5a8b85f4e Merge branch 'master' into develop 2023-04-04 20:34:31 +02:00
Michael Teeuw
fa40a3e8e8 Prepare release 2.23.0 2023-04-04 20:13:45 +02:00
Veeck
6223584392
Add sendNotifications option to clock module (#3059)
Fixes #3056 

One question here would be if the default for this new option should be
true or false.

True: keeps the current behaviour, nobody needs to change his config if
they rely on this option

False: keeps the clock notifications quiet, doesnt waste time/resources,
keeps the noise low

Maybe the original author @cybex-dev can weigh in on this, and why he
added this notification.

---------

Co-authored-by: veeck <michael@veeck.de>
2023-04-01 21:40:32 +02:00
Veeck
b5a22bc09b
Add sendNotifications option to clock module (#3059)
Fixes #3056 

One question here would be if the default for this new option should be
true or false.

True: keeps the current behaviour, nobody needs to change his config if
they rely on this option

False: keeps the clock notifications quiet, doesnt waste time/resources,
keeps the noise low

Maybe the original author @cybex-dev can weigh in on this, and why he
added this notification.

---------

Co-authored-by: veeck <michael@veeck.de>
2023-04-01 21:40:05 +02:00
Kristjan ESPERANTO
4ef030af5f
Fix import order in serveronly (#3072)
To fix issue caused by #3071

In order to still fulfill the new linter rule `import/order`, I replaced
the alias with the path.

I also see two other approaches, but I opted for the simplest one here
for now.

The other approaches:
1. Also create an alias for `app`.
2. Use new `imports` (like in PR #2934), but let `_moduleAliases`
untouched to stay compatible to 3rd party modules.

**Edit**: Oh, I thought of another option:
- Add `require("module-alias/register");`
2023-03-25 10:59:57 +01:00
Kristjan ESPERANTO
5f38c53260
Revise require imports (#3071)
- order (external first)
- remove superfluous file extensions
- new line after imports
- deconstruct (only one time (in `check_config.js`))
- fix path (only one time (in `global-setup.js`))
2023-03-22 23:53:10 +01:00
Karsten Hassel
d5395ee3f8
update dependencies and main.css to match new stylelint rules (#3067)
On `develop` my css test failed because I was already on newest
dependencies.

- update deps
- update `main.css` because of stylelint issue

Co-authored-by: Veeck <github@veeck.de>
2023-03-20 22:30:04 +01:00
Kristjan ESPERANTO
ab0876f07a
Update Eslint config, add new rule and handle issue (#3068) 2023-03-20 22:18:58 +01:00
Kristjan ESPERANTO
d276a7ddb9
Use template literals instead of string concatenation (#3066)
We have used it inconsistently till now. Template literals are more
modern and easier to maintain in my opinion.

Because that's a large amount of changes, here's a way to reproduce it:
I added the rule `"prefer-template": "error"` to the `.eslintrc.json`
and did an autofix. Since this caused a new problem in line 409 of
`newsfeed.js`, I reversed it in that line and also removed the rule from
the eslint config file.

The rule is described here:
https://eslint.org/docs/latest/rules/prefer-template

Note: I've played around with some other linter rules as well, and some
seem to point to some specific, non-cosmetic, issues. But before I dive
even deeper and then introduce even bigger and hardly understandable
changes at once, I thought I'd start with this simple cosmetic rule.
2023-03-19 14:32:23 +01:00
Nicholas Fogal
8f8945d418
Issue#3064 html alert title message (#3065)
Fixes [#3064](https://github.com/MichMich/MagicMirror/issues/3064)

- Fixes default alert module nunjucks templates to render HTML by
default unless 'titleType' and 'messageType' are set to 'text' in the
payload data

e.g. 

Display Text:
`this.sendNotification('SHOW_ALERT', {type: "notification", title:
"<u>YoLink LeakSensor</u>", titleType: "text", message: "<b>" +
deviceName + "</b> reported an alarm that needs attention.",
messageType: "text"});`

Display HTML:
`this.sendNotification('SHOW_ALERT', {type: "notification", title:
"<u>YoLink LeakSensor</u>", message: "<b>" + deviceName + "</b> reported
an alarm that needs attention."});`
2023-03-19 13:23:37 +01:00
Karsten Hassel
6d779235cf
fix e2e tests (failed after async changes) (#3063)
by running calendar and newsfeed tests last.

Additional change: allow unit tests to run parallel

This is no fix of the real issue of calendar and newsfeed tests but I
moved them to the end of the tests so other tests are not failing
anymore.

There are coming follow up PR's for the real fixes (when I find the
culprits).

With these change we can stay with the async changes done by @rejas and
https://github.com/MichMich/MagicMirror/pull/3060 is obsolete.
2023-03-12 10:22:23 +01:00
buxxi
beea754514
Fix empty news feed stopping the feed from ever updating again (#3062)
If a news feed returns an empty file it will cause the feed to only show
the previous entries forever since no new fetch is scheduled.
2023-03-11 16:42:13 +01:00
Karsten Hassel
c6db22524a
set all calendar colums to vertical align top (#3055)
The title column was vertical centered before.

Fixes #3053
2023-03-06 22:59:37 +01:00
Andrés Vanegas Jiménez
23ee155ded
Fixed wind speed units for Open-Meteo Weather Provider (#3054)
Resolved technical debt for
[2964](https://github.com/MichMich/MagicMirror/pull/2964):

- Set wind speed unit to m/s
- Rename parameter `past_days` to `pastDays` to be consistent with all
configs
2023-03-01 09:38:38 +01:00
Veeck
1b2785cc56
Cleanup more callback things (#3051)
Looks quite stable on my computers, so maybe we give it a try?

---------

Co-authored-by: veeck <michael@veeck.de>
2023-02-26 18:36:47 +01:00
Veeck
b5b61246e6
Convert load callbacks to async/await (#3050)
Another one of these PRs....
2023-02-22 20:03:05 +01:00
Veeck
498b440174
Convert module-start to async (#3049)
Similar to the node_helper async start PR...

---------

Co-authored-by: veeck <michael@veeck.de>
2023-02-22 18:58:29 +01:00
Veeck
fe0b915a5d
Convert app-start/-stop callbacks to async/await (#3035)
supersedes https://github.com/MichMich/MagicMirror/pull/3027 and just
touches the start/stop calls.

---------

Co-authored-by: veeck <michael@veeck.de>
2023-02-22 18:58:00 +01:00
Veeck
2b792cdbb8
Convert translator callbacks to async/await (#3048)
Co-authored-by: veeck <michael@veeck.de>
2023-02-21 22:58:18 +01:00
Thomas Hirschberger
a23769156e
Show events of a configurable amount of past days (#3046)
Hi,

want to include a birthday calendar to my mirror which shows upcoming
birthdays and as a reminder birthdays of the last two days.
I used
[MMM-CalendarExt2](https://github.com/MMM-CalendarExt2/MMM-CalendarExt2)
for this job in the past but the module is not supported any more and
very complicated to configure.
I managed to style the default calendar module to my needs but what i am
missing is to display already past events within a configurable time
range.

I included the translations of "YESTERDAY" and "DAYBEFOREYESTERDAY" to
all translation files and modified the code to accept a new option
`pastDaysCount` which controls of how many days past events should be
displayed.

---------

Co-authored-by: Veeck <github@veeck.de>
2023-02-21 22:39:21 +01:00
Veeck
6d86ffade4
Fix rounding in precipitation percentage (#3045)
Percentage should be always rounded so that we dont get something like
"47.0000000001 %"

Some small typo and naming fixes also while I am here

---------

Co-authored-by: veeck <michael@veeck.de>
2023-02-20 20:04:40 +01:00
Veeck
390e5d6490
Update thai language (#3044)
actually add it to the tanslation list
and also add the alert translations from
https://github.com/MichMich/MagicMirror/pull/3029 since the OP didnt
seem to work on it (yet)

---------

Co-authored-by: veeck <michael@veeck.de>
Co-authored-by: Suthep Yonphimai <tomzt@users.noreply.github.com>
2023-02-20 20:03:42 +01:00
Kristjan ESPERANTO
b08a4737af
Update stylelint (#3042)
1. Update `stylelint` dependencies
- As of stylelint v15, we do not need `stylelint-config-prettier`
anymore:
https://github.com/prettier/stylelint-config-prettier/releases/tag/v9.0.5
2. Switch to `stylelint-config-standard`:
`stylelint-prettier/recommended` has not been updated for a long time
and still needs the old `stylelint-config-prettier`
3. Handle new `stylelint` issues
2023-02-19 21:36:50 +01:00
Kristjan ESPERANTO
bf28e63709
Move th.json to translations folder (#3043) 2023-02-19 10:51:32 +01:00
Veeck
fb22a76796
Fix precipitation styles (#3041)
They weren't applied to wrong classnames, this PR fixes that and also
expands the weather util tests

---------

Co-authored-by: veeck <michael@veeck.de>
2023-02-18 18:24:11 +01:00