This change replaces the font-awesome moon icon and percent-lit with an
icon showing the current lunar phase.
It uses emoji, which may not be installed on all machines. The fallback
text version is backwards (the dark part of the moon is text-color,
which is normally black but white in MagicMirror).
---------
Co-authored-by: veeck <michael.veeck@nebenan.de>
- Remove "prettier" from plugin array, because it's already enabled by
"plugin:prettier/recommended"
- Remove "jsdoc" from plugin array, because it's already enabled by
"plugin:jsdoc/recommended"
- Enable recommended import rules
- Add two additional import rules
Note: To avoid overloading this PR I'll tackle the jest part with
another PR after this one has been dealt with.
I try to use only `html-to-text` library
it's will solve issue #3235
@rejas, @sdetweil, @khassel: Can you do tests with your own feeds?
Thanks for feedbacks
Added my (modified) updater main core into updatenotification default
module
Missing: callback display in MM² (i will code it after)
new part of configuration added:
```
updates: [
// array of module update commands
{
// with embed npm script
"MMM-Test": "npm run update"
},
{
// with "complex" process
"MMM-OtherSample": "rm -rf package-lock.json && git reset --hard && git pull && npm install"
},
{
// with git pull && npm install
"MMM-OtherSample2": "git pull && npm install"
},
{
// with a simple git pull
"MMM-OtherSample3": "git pull"
}
],
updateTimeout: 2 * 60 * 1000, // max update duration
updateAutorestart: false // autoRestart MM when update done ?
```
@khassel: i need your help
I don't use docker, maybe you can help me for this:
How can i check if MM² is running inside a docker ? (from MM² main core)
Actually, I check if we use pm2 or not.
I have to check if docker is used or not too
last time you tell me: "you can't use updater with docker", so I want to
check and deny any update if docker used
---------
Co-authored-by: bugsounet <bugsounet@bugsounet.fr>
Fixes: #3256
BUT.. the testcase is inconclusive.. as the code FAILS without the fix,
BUT somehow RETURNS 0 entries..
in real life run the node helper fails, and all calendar processing
stops.
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?
> - 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.
**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!
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.
DONE ;D
> 2. Include these infos in the description:
> - Does the pull request solve a **related** issue?
NO
> - What does the pull request accomplish? Use a list if needed.
For calendar entries containing a year (e.g. DOB) in the title, the age
can be calculated.
Example before:

after:

Achieved by adding a new keyword `transform` to customEvents
```
customEvents: [
{keyword: 'Geburtstag', symbol: 'birthday-cake', color: 'Gold', transform: { search: '^([^\']*) \'(\\d{4})$' , replace: '$1 ($2.)', yearmatchgroup: 2}},
{keyword: 'in Hamburg', transform: { search: ' in Hamburg$' , replace: ''}}
],
```
and therewith obsoleting `titleReplace`; a backward compatibility part
is already included.
If `yearmatchgroup` is unset, behaviour is as in previous code (some
additions to which RegExes are accepted, though)
If `yearmatchgroup` is set, it is considered the RegEx match group id,
which will be used for calculating the age.
> - If it includes major visual changes please add screenshots.
NO
> 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
> Thanks again and have a nice day!
You too and if any questions, feel free to let me know.
---------
Co-authored-by: veeck <michael.veeck@nebenan.de>
related to #3185
* I have limited updated dom to one update
-> `updateDom()` is activated by a timer which resets when a new event
arrives (`CALENDAR_EVENTS`)
* I have set no speed to self update. I think it's not necessary
-> update it directly
If somebody can test and tell me result
In all case, I will patch my prod mirror for testing
Fixes#3227
and also
- removes unused code
- de-duplicates code fragments
- fixes typos
- inlines code
- adds more weather util tests
@martingron and @Justheretoreportanissue would you be so kind to check
if I didnt mess anything up?
Fixes https://github.com/MichMich/MagicMirror/issues/3182
Fixed issue with probability of precipitation not showing up on hourly
or daily forecast
---------
Co-authored-by: veeck <michael.veeck@nebenan.de>
Hello,
This pull request allows you to add a class to the tr of the event
sought in customEvents. You must enter the class with the "eventClass"
option.
---------
Co-authored-by: TeddyStarinvest <teddy.payet@starinvest.com>
related to #2649
I was able to move to internal fetch and all tests seems fine so far.
But we have one problem with the calendar module. In the docs we have
several authentication methods and one of them is `digest`. For this we
used `digest-fetch` which needs `node-fetch` (this is not so clear from
code but I was not able to get it working).
So we have 3 options:
- remove `digest` as authentication method for calendar module (this is
what this PR does at the moment)
- find an alternative npm package or implement the digest stuff
ourselves
- use `digest-fetch` and `node-fetch` for calendar module (so they would
remain as dependencies in `package.json`)
Opinions? @KristjanESPERANTO @rejas @sdetweil @MichMich
Update calendarfetcherutils.js to force recurrence date time to be the
same as event datetime
I found an issue with one of my calendars displaying the wrong time for
certain recurring events. Each event was set up by someone in a
different timezone (Central European) than my own (Eastern US). I traced
the issue back to the `Rrule.between()` method generating odd time
portions under certain circumstances.
The fix I found was to set the UTC time portion of the recurrence
datetime to be the same as the UTC time portion of the event start date.
This resolved the issues with the maladjusted event times, and had no
effect on other event times. While there may be edge cases that are
affected, I have been unable to locate any.
---------
Co-authored-by: Veeck <github@veeck.de>
Fixes#3126
Added the option `allowOverrideNotification` to `weather.js`. This
allows the module to receive the `CURRENT_WEATHER_OVERRIDE`
notification. The expected payload for this notification is a
full/partial `weatherObject` that is used to supplement/replace the
existing `weatherObject` returned by whichever weather provider is in
use.
No visual changes.
First time contributing - let me know if I've missed something
🙂
---------
Co-authored-by: veeck <michael.veeck@nebenan.de>
fixes#3138 just in case #3137 doesnt get worked on until the next
release
- inc fetchInterval for sample calender
- add fetchInterval config per calendar
... but e.g. a version tag
fixes#3130
This happens e.g. in my docker image where I use the version tag to get
the mm sources.
With this PR the error message is avoided and there will be never an
updatenotification when using a tag. This is o.k. because a tag should
never be moved.
Hi,
Like some default modules, I propose to send an `UPDATES` notification
in an array with the git information of these modules
This allows developers to create their own auto-update system (which
I've been using in my case since 3 years, with automatic things)
Of course, for security reasons `MagicMirror` is excluded
---------
Co-authored-by: bugsounet <bugsounet@bugsounet.fr>
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

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>
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)
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>
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.
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>
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>
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>
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>
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>
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>
- 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`))
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.
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."});`