"Inspired" by my mistake in
https://github.com/MichMich/MagicMirror/pull/3028 this PR will add a
worfklow check for the branch a PR is based against.
Open question is if this prevents @MichMich from preparing a release?
---------
Co-authored-by: veeck <michael@veeck.de>
This commit adds several QOL features and adjustments to the calendar
module including:
- **New Options**
- ``coloredText``: ``(default: false)`` Determines if you want your
entry text to be colored based on the calendar's color
- ``coloredBorder``: ``(default: false)`` Determines if you want entry
borders to be colored based on the calendar's color
- ``coloredSymbol``: ``(default: false)`` Determines if you want entry
symbols to be colored based on the calendar's color
- ``coloredBackground``: ``(default: false)`` Determines if you want
entry backgrounds to be colored based on the calendar's color
> These new colored options allows for more out-of-box styling options
for the calendar module. With this the ``coloredSymbolOnly`` option has
been removed due to redundancy
- ``limitDaysNeverSkip``: ``(default: false)`` show every event for
every day regardless of if the day only has a single full day event
- ``flipDateHeaderTitle``: ``(default: false)`` determines if the title
for the date header in the ``dateheaders`` time format should align to
the left ``[eg: false]`` or right ``[eg: true]``
- **Layout Changes**
- ``dateheader`` is now a class avaliable for date headers in the
``dateheaders`` time format.
- Event entries have been better *container-ized* for better styling
(using the ``event-container`` class)
- ``repeatingCountTitle`` now has a seperator between the ``yearDiff``
and ``repeatingCountTitle``
- ``endDate`` in ``dateheaders`` now capitalizes it's first letter
Fixes#2953
This is an attempt to fix the issue with precipitation amount and
percentage mixup. I have created a separate
`precipitationPercentage`-variable where the probability of rain can be
stored.
The config options now has the old `showPrecipitationAmount` in addition
to a new setting: `showPrecipitationProbability` (shows the likelihood
of rain).
<details>
<summary>Examples</summary>
### Yr
I tested the Yr weather provider for a Norwegian city Bergen that has a
lot of rain. I have removed properties that are irrelevant for this demo
from the config-samples below.
Config:
```js
{
module: "weather",
config: {
weatherProvider: "yr",
type: "current",
showPrecipitationAmount: true,
showPrecipitationProbability: true
}
},
{
module: "weather",
config: {
weatherProvider: "yr",
type: "hourly",
showPrecipitationAmount: true,
showPrecipitationProbability: true
}
},
{
module: "weather",
config: {
weatherProvider: "yr",
type: "daily",
showPrecipitationAmount: true,
showPrecipitationProbability: true
}
}
```
Result:<br/>
<img width="444" alt="screenshot"
src="https://user-images.githubusercontent.com/34011212/216775423-4e37345c-f915-47e5-8551-7c544ebd24b1.png">
</details>
---------
Co-authored-by: Magnus Marthinsen <magmar@online.no>
Co-authored-by: Veeck <github@veeck.de>
Async node_helper dont have to finish immediately in loadModules. So the
start callback in the app.js with the config isnt called for some time.
But the electron ready event can already be fired in the meantime.
This lead to the electron app starting but without a config (which is
provded by the node_helper callback) therefor crashing.
This PR fixes#2487 by moving the callback call out of the loadModules
block, therefor the config is provided in time.
If any new async node_helper doesnt like this, we will see it :-)
Co-authored-by: veeck <michael@veeck.de>
see discussion here:
https://github.com/MichMich/MagicMirror/pull/2991#issuecomment-1376372720
I still see a need for updating `master` in special cases (e.g. correct
errors in README.md which would otherwise be present up to 3 month until
next release) so with this PR **only for MagicMirror repo** and **only
for `master` branch** updatenotifications are only triggered if at least
one of the new commits has a tag.
May @MichMich must decide if this is wanted.
Co-authored-by: Veeck <github@veeck.de>
This simple change allows to use your own templates (under "templates"
directory). The parameter `templateName` is optional (ignored on falsy
value - undefined, null, empty string, etc.) and independent of `type`.
Co-authored-by: Veeck <github@veeck.de>
This keeps relative dates accurate when the calendar's fetch frequency
is much larger than a minute.
As fetching incurs network traffic and load on servers and most
calendars don't update that often, simply refreshing locally is enough.
When using relative for today's events, dates will show as "in X
minutes" or "ends in X minutes" for events within an hour and this goes
out of date quickly. It's weird to see that the time is, say, 16:30 and
an event that you know ends at 16:45 is shown to "ends in 23 minutes"
because that's when the last fetch happened.
Please forgive me if there's style issue, I don't have npm set up on my
machine to run the formatter.
Fixes#3019
The previous implementation had the arrow pointing in to the wind. When
the wind blows from the north (0 degrees), the arrow should point
straight down. In other words, no rotation of the arrow-down symbol.
When the wind blows from the south (180 degrees), the arrow should point
straight up (I.e. the arrow down symbol rotated 180 degrees).
Co-authored-by: Magnus Marthinsen <magmar@online.no>
Fixes so the Yr weather direction is not inverted. This error was
[reported in the
community](https://forum.magicmirror.builders/topic/17561/wind-direction-180-degrees-twisted-at-yr).
I misunderstood when developing the module because of the wind direction
arrow was pointing opposite to the arrow displayed on Yr.no. I renamed
the variable to help other developers in the future.
Co-authored-by: Magnus Marthinsen <magmar@online.no>
Co-authored-by: veeck <michael@veeck.de>
Symbols provided in customEvents don't get the "fas fa-fw fa-" prefix,
which according to the docs they should. This fixes that.
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!
Co-authored-by: veeck <michael@veeck.de>
Hourly forecast wasnt converted properly during the last release cycle,
one fix and two cleanups were necessary.
Fixes#3010
Co-authored-by: veeck <michael@veeck.de>
was [requested in the
forum](https://forum.magicmirror.builders/topic/17519/updatenotification).
- added possibility to exclude MagicMirror Repo and renamed it from
`default` to `MagicMirror`
- improved getting `behind` in case a hard `git fetch` was already done
- removed test "excludes repo if refs don't match regex" because of
above improvement this case is obsolete
- improved `git fetch --dry-run` with `-n` option to exclude tags (noise
reduction)
Refactored the mock data generation for the tests so we can use plain
JSON files for the data and read it in a more general way.
Comments welcome!
Co-authored-by: veeck <michael@veeck.de>
Adds new config option to show weather forecast for every X hour
(default value is 1 which reflects the current behaviour)
Also adds tests for hourly forecast
Fixes#2996
Co-authored-by: veeck <michael@veeck.de>
## [2.22.0] - 2023-01-01
Thanks to: @angeldeejay, @buxxi, @dariom, @dWoolridge,
@KristjanESPERANTO, @MagMar94, @naveensrinivasan, @retroflex, @SkySails
and @Tom.
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!
### Added
- Added test for remoteFile option in compliments module
- Added hourlyWeather functionality to Weather.gov weather provider
- Removed weatherEndpoint definition from weathergov.js (not used)
- Added css class names "today" and "tomorrow" for default calendar
- Added Collaboration.md
- Added new github action for dependency review (#2862)
- Added a WeatherProvider for Open-Meteo
- Added Yr as a weather provider
- Added config options "ignoreXOriginHeader" and
"ignoreContentSecurityPolicy"
### Removed
- Removed usage of internal fetch function of node until it is more
stable
### Updated
- Cleaned up test directory (#2937) and jest config (#2959)
- Wait for all modules to start before declaring the system ready
(#2487)
- Updated e2e tests (moved `done()` in helper functions) and use es6
syntax in all tests
- Updated da translation
- Rework weather module
- Make sure smhi provider api only gets a maximum of 6 digits
coordinates (#2955)
- Use fetch instead of XMLHttpRequest in weatherprovider (#2935)
- Reworked how weatherproviders handle units (#2849)
- Use unix() method for parsing times, fix suntimes on the way (#2950)
- Refactor conversion functions into utils class (#2958)
- The `cors`-method in `server.js` now supports sending and recieving
HTTP headers
- Replace `…` by `…`
- Cleanup compliments module
- Updated dependencies including electron to v22 (#2903)
### Fixed
- Correctly show apparent temperature in SMHI weather provider
- Ensure updatenotification module isn't shown when local is _ahead_ of
remote
- Handle node_helper errors during startup (#2944)
- Possibility to change FontAwesome class in calendar, so icons like
`fab fa-facebook-square` works.
- Fix cors problems with newsfeed articles (as far as possible), allow
disabling cors per feed with option `useCorsProxy: false` (#2840)
- Tests not waiting for the application to start and stop before
starting the next test
- Fix electron tests failing sometimes in github workflow
- Fixed gap in clock module when displayed on the left side with
displayType=digital
- Fixed playwright issue by upgrading to v1.29.1 (#2969)
Signed-off-by: naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
Co-authored-by: Malte Hallström <46646495+SkySails@users.noreply.github.com>
Co-authored-by: Veeck <github@veeck.de>
Co-authored-by: veeck <michael@veeck.de>
Co-authored-by: dWoolridge <dwoolridge@charter.net>
Co-authored-by: Johan <jojjepersson@yahoo.se>
Co-authored-by: Dario Mratovich <dario_mratovich@hotmail.com>
Co-authored-by: Dario Mratovich <dario.mratovich@outlook.com>
Co-authored-by: Magnus <34011212+MagMar94@users.noreply.github.com>
Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com>
Co-authored-by: buxxi <buxxi@omfilm.net>
Co-authored-by: Thomas Hirschberger <47733292+Tom-Hirschberger@users.noreply.github.com>
Co-authored-by: Kristjan ESPERANTO <35647502+KristjanESPERANTO@users.noreply.github.com>
Co-authored-by: Andrés Vanegas Jiménez <142350+angeldeejay@users.noreply.github.com>
## Added Weather Provider for Open-Meteo.
I've found a completely free weather REST API (event with option of
self-hosting) after having problems with API keys from all MagicMirror
weather providers currently implemented (the remote services, not the
providers themselves).
This API doesn't return information about reverse geocode from latitude
and longitude options like others. I solved that issue using another
free API.
### APIs used
- [Open-Meteo Weather Forecast API](https://open-meteo.com/en/docs)
- [BigDataCloud’s Free Client-Side Reverse Geocoding
API](https://www.bigdatacloud.com/docs/api/free-reverse-geocode-to-city-api)
### Considerations
- This provider is config reliable so, be free to use the same config
you can found in the official MagicMirror Weather module documentation.
- This module config skips the `apiKey` parameter. It's not used at all.
Only `latitude` and `longitude` are required.
#### Config examples:
```
modules: [
{
module: "weather",
position: "top_right",
header: "Weather Forecast",
config: {
updateInterval: <number here>,
weatherProvider: "openmeteo",
type: "current",
lat: <number here>,
lon: <number here>,
showHumidity: true,
showWindDirectionAsArrow: true,
showWindDirection: true,
degreeLabel: true,
}
},
{
module: "weather",
position: "top_right",
header: "Weather Forecast",
config: {
updateInterval: <number here>,
weatherProvider: "openmeteo",
type: "daily",
lat: <number here>,
lon: <number here>
colored: true,
maxNumberOfDays: <number here>,
showPrecipitationAmount: true,
appendLocationNameToHeader: true
}
},
{
module: "weather",
position: "top_right",
header: "Weather Forecast",
config: {
updateInterval: <number here>,
weatherProvider: "openmeteo",
type: "hourly",
lat: <number here>,
lon: <number here>,
maxEntries: <number here>,
showPrecipitationAmount: true,
degreeLabel: true,
appendLocationNameToHeader: true
}
},
]
```
Co-authored-by: Michael Teeuw <michael@xonaymedia.nl>
Lots of small fixes and cleanups:
- only render something when there is a compliment
- cleanup naming
- use es6 notations
- use fetch instead of XMLHttpRequest in compliments
Co-authored-by: veeck <michael@veeck.de>
Co-authored-by: Karsten Hassel <hassel@gmx.de>
Changes:
- as discussed in #2903: update to electron v22 (we can revert it before
next release if we find any problems)
- update other dependencies
- set playwright to version v1.27.1 until #2969 is solved
# Added Yr.no as a weather provider
Yr.no is a free Norwegian weather service. The configuration is quite
simple:
```js
{
weatherProvider: "yr",
lat: 59.9171,
lon: 10.7276,
altitude: 30
}
```
The latitude and longitude cannot have more than 4 decimals, but that
should be plenty. To quote yr: "There is no need to ask for weather
forecasts with nanometer precision!". The altitude should be meters
above sea level and defaults to 0. If `type` is set to `current` the
symbol can display the next 1, 6 or 12 hours by setting
`currentForecastHours` (default is 1).
It states in [Getting
started-guide](https://developer.yr.no/doc/GettingStarted/) that users
of the API should cache the results and use the `Expires`-header to know
when to ask for new data. By using the `If-Modified-Since`-header we can
avoid downloading the same data over and over again. I chose not to
override the `User-Agent`-header set in
[`server.js`](https://github.com/MichMich/MagicMirror/blob/a328ce5/js/server.js#L97)
even though it does not comply with [the terms of
service](https://developer.yr.no/doc/TermsOfService/). It currently
works with the default header, and by searching the web for MagicMirror
the GitHub-repo should be easy to find without an explicit link.
I also had to make some minor changes to `server.js` and
`weatherprovider.js` to be able to send and return HTTP headers. To
handle the HTTP 304 response without body I chose to return `undefined`
so we easily can use the response as a condition: `if (response) ...`.
The documentation for the API is available here:
- [API Reference overview](https://api.met.no/weatherapi/)
-
[Locationforecast](https://api.met.no/weatherapi/locationforecast/2.0/)
- Used to get the weather forecast
- [Sunrise](https://api.met.no/weatherapi/sunrise/2.0/documentation) -
used to find sunrise and sunset times
Co-authored-by: Veeck <github@veeck.de>
Many users like me do have the problem that they want to embed other
sites to their mirror by "iframe".
As some developers set the "x-frame-options" and
"content-security-policy" for security reasons these sites can not be
embedded.
Electron provides the "webview" element additionally to "iframe" which
allows to embed these sites although. The main difference is that a new
process is started which handles the "webview" element.
BUT: As the "webview" process needs to be started and is isolated
"webview" is slower and the elements can not be accessed from the
embedding website.
As an alternative i implemented a small callback function in electron.js
which removes the response headers that forbid the embedding.
The removing can be controlled with the new config options:
* ignoreXOriginHeader
* ignoreContentSecurityPolicy
As already discussed here the first shot of the collaboration rules.
We can discuss this in the comments until ready to merge.
Co-authored-by: Veeck <github@veeck.de>
Adds support for sending and receiving HTTP-headers when using the
CORS-method.
This change is required for the Yr weather-provider introduced in
https://github.com/MichMich/MagicMirror/pull/2948.
To make it easier to add unit tests I moved the server-functions into a
separate file.