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)
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>
## 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>
# 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>
So finally I think this refactorin is ready to be reviewed :-)
DONE:
- [x] Removed all conversion functions for wind and temperature from
specific weatherproviders
- [x] Use internally only metric units: celsius for temperature, meters
per seconds for wind
- [x] Convert temp and wind into the configured units when displaying
data on the UI
- [x] look how beaufort calculation uses metrics, added knots as new
windunit
- [x] add more e2e tests
Checked providers:
- [x] Darksky
- [x] EnvCanada
- [x] OpenWeatherMap
- [x] SMHI provider
- [x] UK Met Office
- [x] UK Met Office DataHub
- [x] WeatherBit
- [x] WeatherFlow
- [x] WeatherGov
TODO in different tickets:
- check weatherproviders for usage of weatherEndpoint (as seen in
https://github.com/MichMich/MagicMirror-Documentation/issues/131) -> see
#2926
- cleanup precipations -> #2953
Co-authored-by: veeck <michael@veeck.de>
solves #2840 as far as possible. There could still be errors on the
embedded iframe when the owner of the site has set `X-Frame-Options` or
`Access-Control-Allow-Origin` headers (as already mentioned in the
docs).
first PR for #2942
- added new electron tests for calendar which test new css classes from
https://github.com/MichMich/MagicMirror/pull/2939
- moved some compliments tests from `e2e` to `electron` because of date
mocking
- removed mock stuff from compliments module
Some icons in FontAwesome, like the Facebook-logo, requires a different
class than `fas fa-fw fa-`. Added support for specifying the
`className`:
```js
{
symbol: "facebook-square",
symbolClassName: "fab fa-",
url: "https://www.facebook.com/events/ical/upcoming/?uid=<some_uid>"
}
```
This PR resolves a small bug in the updatenotification module if a local
git repo is ahead of the remote (for example I have made local commits
for my personal needs).
Currently, if `git status -sb` reports a status like: `##
master...origin/master [ahead 2]` then updatenotification treats this as
though it's "behind".
This PR uses a single Regex to match `git status -sb` output and uses
capture groups to extract info to populate the `gitInfo` object to avoid
needing to do string manipulation to extract this information.
Co-authored-by: Dario Mratovich <dario.mratovich@outlook.com>
Added class names "today" and "tomorrow" on the calendar module tr
elements (i.e. calendar items).
This way you can for example color your events today and/or tomorrow to
more easily see what's happening in the near future.
Implemented by adding an event.tomorrow variable (similar to
event.today) that can be used for other things in the future. Also
replaced a few hardcoded values (hours, seconds etc.) with constants to
make the code more consistent.
Edit: tested with normal events, split day events and events with
locations.
small update to the fetchData method to use the fetch helper instead of
the old XCMLHttpRequest.
Also fixes some typos :-)
Co-authored-by: veeck <michael@veeck.de>
This PR addresses [this
comment](48756e8774 (commitcomment-85772193)),
which points out an issue with #2902.
Looks like the apparent temp calculation method was incorrectly
referenced 😅