mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-07-03 22:36:09 +00:00
Merge pull request #1703 from rejas/fix_eslint_errors_automatically
Fix tests
This commit is contained in:
commit
2b7accaf68
@ -19,13 +19,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
- Add `broadcastPastEvents` config option for calendars to include events from the past `maximumNumberOfDays` in event broadcasts
|
- Add `broadcastPastEvents` config option for calendars to include events from the past `maximumNumberOfDays` in event broadcasts
|
||||||
- Added feature to broadcast news feed items `NEWS_FEED` and updated news items `NEWS_FEED_UPDATED` in default [newsfeed](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/newsfeed) module (when news is updated) with documented default and `config.js` options in [README.md](https://github.com/MichMich/MagicMirror/blob/develop/modules/default/newsfeed/README.md)
|
- Added feature to broadcast news feed items `NEWS_FEED` and updated news items `NEWS_FEED_UPDATED` in default [newsfeed](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/newsfeed) module (when news is updated) with documented default and `config.js` options in [README.md](https://github.com/MichMich/MagicMirror/blob/develop/modules/default/newsfeed/README.md)
|
||||||
- Added notifications to default `clock` module broadcasting `CLOCK_SECOND` and `CLOCK_MINUTE` for the respective time elapsed.
|
- Added notifications to default `clock` module broadcasting `CLOCK_SECOND` and `CLOCK_MINUTE` for the respective time elapsed.
|
||||||
|
- Added UK Met Office Datapoint feed as a provider in the default weather module.
|
||||||
Added UK Met Office Datapoint feed as a provider in the default weather module.
|
|
||||||
- added new provider class
|
- added new provider class
|
||||||
- added suncalc.js dependency to calculate sun times (not provided in UK Met Office feed)
|
- added suncalc.js dependency to calculate sun times (not provided in UK Met Office feed)
|
||||||
- added "tempUnits" and "windUnits" to allow, for example, temp in metric (i.e. celsius) and wind in imperial (i.e. mph). These will override "units" if specified, otherwise the "units" value will be used.
|
- added "tempUnits" and "windUnits" to allow, for example, temp in metric (i.e. celsius) and wind in imperial (i.e. mph). These will override "units" if specified, otherwise the "units" value will be used.
|
||||||
- use Feels Like temp from feed if present
|
- use Feels Like temp from feed if present
|
||||||
- optionally display probability of precipitation (PoP) in current weather (UK Met Office data)
|
- optionally display probability of precipitation (PoP) in current weather (UK Met Office data)
|
||||||
|
- automatically try to fix eslint errors by passing `--fix` option to it
|
||||||
|
|
||||||
### Updated
|
### Updated
|
||||||
- English translation for "Feels" to "Feels like"
|
- English translation for "Feels" to "Feels like"
|
||||||
|
@ -4,6 +4,7 @@ module.exports = function(grunt) {
|
|||||||
pkg: grunt.file.readJSON("package.json"),
|
pkg: grunt.file.readJSON("package.json"),
|
||||||
eslint: {
|
eslint: {
|
||||||
options: {
|
options: {
|
||||||
|
fix: "true",
|
||||||
configFile: ".eslintrc.json"
|
configFile: ".eslintrc.json"
|
||||||
},
|
},
|
||||||
target: [
|
target: [
|
||||||
|
@ -135,7 +135,7 @@ Module.register("calendar", {
|
|||||||
}
|
}
|
||||||
} else if (notification === "FETCH_ERROR") {
|
} else if (notification === "FETCH_ERROR") {
|
||||||
Log.error("Calendar Error. Could not fetch calendar: " + payload.url);
|
Log.error("Calendar Error. Could not fetch calendar: " + payload.url);
|
||||||
this.loaded = true
|
this.loaded = true;
|
||||||
} else if (notification === "INCORRECT_URL") {
|
} else if (notification === "INCORRECT_URL") {
|
||||||
Log.error("Calendar Error. Incorrect url: " + payload.url);
|
Log.error("Calendar Error. Incorrect url: " + payload.url);
|
||||||
} else {
|
} else {
|
||||||
|
@ -171,8 +171,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
|||||||
var geo = event.geo || false;
|
var geo = event.geo || false;
|
||||||
var description = event.description || false;
|
var description = event.description || false;
|
||||||
|
|
||||||
|
if (typeof event.rrule !== "undefined" && event.rrule !== null && !isFacebookBirthday) {
|
||||||
if (typeof event.rrule !== 'undefined' && event.rrule !== null && !isFacebookBirthday) {
|
|
||||||
var rule = event.rrule;
|
var rule = event.rrule;
|
||||||
var addedEvents = 0;
|
var addedEvents = 0;
|
||||||
|
|
||||||
@ -210,7 +209,6 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Loop through the set of date entries to see which recurrences should be added to our event list.
|
// Loop through the set of date entries to see which recurrences should be added to our event list.
|
||||||
for (var d in dates) {
|
for (var d in dates) {
|
||||||
var date = dates[d];
|
var date = dates[d];
|
||||||
@ -246,7 +244,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri
|
|||||||
|
|
||||||
endDate = moment(parseInt(startDate.format("x")) + duration, "x");
|
endDate = moment(parseInt(startDate.format("x")) + duration, "x");
|
||||||
if (startDate.format("x") == endDate.format("x")) {
|
if (startDate.format("x") == endDate.format("x")) {
|
||||||
endDate = endDate.endOf("day")
|
endDate = endDate.endOf("day");
|
||||||
}
|
}
|
||||||
|
|
||||||
var recurrenceTitle = getTitleFromEvent(curEvent);
|
var recurrenceTitle = getTitleFromEvent(curEvent);
|
||||||
|
@ -60,7 +60,7 @@ module.exports = NodeHelper.create({
|
|||||||
});
|
});
|
||||||
|
|
||||||
fetcher.onError(function(fetcher, error) {
|
fetcher.onError(function(fetcher, error) {
|
||||||
console.error("Calendar Error. Could not fetch calendar: ", fetcher.url(), error)
|
console.error("Calendar Error. Could not fetch calendar: ", fetcher.url(), error);
|
||||||
self.sendSocketNotification("FETCH_ERROR", {
|
self.sendSocketNotification("FETCH_ERROR", {
|
||||||
url: fetcher.url(),
|
url: fetcher.url(),
|
||||||
error: error
|
error: error
|
||||||
|
@ -273,13 +273,13 @@ Module.register("newsfeed",{
|
|||||||
newsItems.forEach(value => {
|
newsItems.forEach(value => {
|
||||||
if (this.newsItems.findIndex(value1 => value1 === value) === -1) {
|
if (this.newsItems.findIndex(value1 => value1 === value) === -1) {
|
||||||
// Add item to updated items list
|
// Add item to updated items list
|
||||||
updatedItems.push(value)
|
updatedItems.push(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// check if updated items exist, if so and if we should broadcast these updates, then lets do so
|
// check if updated items exist, if so and if we should broadcast these updates, then lets do so
|
||||||
if (this.config.broadcastNewsUpdates && updatedItems.length > 0) {
|
if (this.config.broadcastNewsUpdates && updatedItems.length > 0) {
|
||||||
this.sendNotification("NEWS_FEED_UPDATE", {items: updatedItems})
|
this.sendNotification("NEWS_FEED_UPDATE", {items: updatedItems});
|
||||||
}
|
}
|
||||||
|
|
||||||
this.newsItems = newsItems;
|
this.newsItems = newsItems;
|
||||||
|
@ -211,7 +211,7 @@ Module.register("weather",{
|
|||||||
value = "";
|
value = "";
|
||||||
} else {
|
} else {
|
||||||
if (this.config.weatherProvider === "ukmetoffice") {
|
if (this.config.weatherProvider === "ukmetoffice") {
|
||||||
value += "%"
|
value += "%";
|
||||||
} else {
|
} else {
|
||||||
value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`;
|
value = `${value.toFixed(2)} ${this.config.units === "imperial" ? "in" : "mm"}`;
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ class WeatherObject {
|
|||||||
|
|
||||||
feelsLike() {
|
feelsLike() {
|
||||||
if (this.feelsLikeTemp) {
|
if (this.feelsLikeTemp) {
|
||||||
return this.feelsLikeTemp
|
return this.feelsLikeTemp;
|
||||||
}
|
}
|
||||||
const windInMph = (this.windUnits === "imperial") ? this.windSpeed : this.windSpeed * 2.23694;
|
const windInMph = (this.windUnits === "imperial") ? this.windSpeed : this.windSpeed * 2.23694;
|
||||||
const tempInF = this.tempUnits === "imperial" ? this.temperature : this.temperature * 9 / 5 + 32;
|
const tempInF = this.tempUnits === "imperial" ? this.temperature : this.temperature * 9 / 5 + 32;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user