Skip to content
Permalink
Browse files

Merge pull request #1776 from MichMich/develop

v2.9.0
  • Loading branch information...
MichMich committed Oct 1, 2019
2 parents a31546b + d90de18 commit 500147e1300c544f99ebb63c6a8a2769e5f96f9b
Showing with 3,136 additions and 2,028 deletions.
  1. +1 −0 .eslintrc.json
  2. +5 −1 .gitignore
  3. +1 −0 .travis.yml
  4. +27 −4 CHANGELOG.md
  5. +1 −1 LICENSE.md
  6. +0 −7 installers/raspberry.sh
  7. +1 −1 js/main.js
  8. +1 −1 modules/default/calendar/vendor/ical.js/node-ical.js
  9. +31 −17 modules/default/clock/clock.js
  10. +1 −1 modules/default/currentweather/currentweather.js
  11. +5 −0 modules/default/newsfeed/newsfeed.js
  12. +14 −8 modules/default/updatenotification/node_helper.js
  13. +69 −41 modules/default/updatenotification/updatenotification.js
  14. +4 −2 modules/default/weather/providers/darksky.js
  15. +2 −0 modules/default/weather/providers/openweathermap.js
  16. +2 −0 modules/default/weather/providers/ukmetoffice.js
  17. +2 −0 modules/default/weather/providers/weathergov.js
  18. 0 modules/default/weather/weather.js
  19. +0 −4 modules/default/weather/weatherprovider.js
  20. +34 −1 modules/default/weatherforecast/weatherforecast.js
  21. +2,220 −1,932 package-lock.json
  22. +3 −2 package.json
  23. +3 −0 run-start.sh
  24. +35 −0 tests/configs/modules/weather/currentweather_default.js
  25. +40 −0 tests/configs/modules/weather/currentweather_options.js
  26. +37 −0 tests/configs/modules/weather/currentweather_units.js
  27. +37 −0 tests/configs/modules/weather/forecastweather_default.js
  28. +40 −0 tests/configs/modules/weather/forecastweather_options.js
  29. +4 −0 tests/e2e/modules/mocks/index.js
  30. +54 −0 tests/e2e/modules/mocks/weather_current.js
  31. +97 −0 tests/e2e/modules/mocks/weather_forecast.js
  32. +270 −0 tests/e2e/modules/weather_spec.js
  33. +13 −2 tests/e2e/vendor_spec.js
  34. +33 −0 tests/node_modules/webdriverajaxstub/index.js
  35. 0 translations/en.json
  36. +2 −1 translations/es.json
  37. +33 −0 translations/ms-my.json
  38. +2 −1 translations/translations.js
  39. +11 −0 untrack-css.sh
  40. +1 −1 vendor/package-lock.json
@@ -17,6 +17,7 @@
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2017,
"ecmaFeatures": {
"globalReturn": true
}
@@ -11,7 +11,9 @@ coverage
.grunt
.lock-wscript
build/Release
node_modules
/node_modules/**/*
fonts/node_modules/**/*
vendor/node_modules/**/*
jspm_modules
.npm
.node_repl_history
@@ -81,3 +83,5 @@ Temporary Items
*.orig
*.rej
*.bak

!/tests/node_modules/**/*
@@ -1,3 +1,4 @@
dist: trusty
language: node_js
node_js:
- "8"
@@ -7,6 +7,29 @@ This project adheres to [Semantic Versioning](http://semver.org/).

❤️ **Donate:** Enjoying MagicMirror²? [Please consider a donation!](https://magicmirror.builders/donate) With your help we can continue to improve the MagicMirror² core.

## [2.9.0] - 2019-10-01

ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md).

### Added
- Spanish translation for "PRECIP".
- Adding a Malay (Malaysian) translation for MagicMirror².
- Add test check URLs of vendors 200 and 404 HTTP CODE.
- Add tests for new weather module and helper to stub ajax requests.

### Updated
- Updatenotification module: Display update notification for a limited (configurable) time.
- Enabled e2e/vendor_spec.js tests.
- The css/custom.css will be rename after the next release. We've add into `run-start.sh` a instruction by GIT to ignore with `--skip-worktree` and `rm --cached`. [#1540](https://github.com/MichMich/MagicMirror/issues/1540)
- Disable sending of notification CLOCK_SECOND when displaySeconds is false.

### Fixed
- Updatenotification module: Properly handle race conditions, prevent crash.
- Send `NEWS_FEED` notification also for the first news messages which are shown.
- Fixed issue where weather module would not refresh data after a network or API outage. [#1722](https://github.com/MichMich/MagicMirror/issues/1722)
- Fixed weatherforecast module not displaying rain amount on fallback endpoint.
- Notifications CLOCK_SECOND & CLOCK_MINUTE being from startup instead of matched against the clock and avoid drifting.

## [2.8.0] - 2019-07-01

ℹ️ **Note:** This update uses new dependencies. Please update using the following command: `git pull && npm install`. If you are having issues running Electron, make sure your [Raspbian is up to date](https://www.raspberrypi.org/documentation/raspbian/updating.md).
@@ -28,18 +51,18 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Automatically try to fix eslint errors by passing `--fix` option to it
- Added sunrise and sunset times to weathergov weather provider [#1705](https://github.com/MichMich/MagicMirror/issues/1705)
- Added "useLocationAsHeader" to display "location" in `config.js` as header when location name is not returned
- Added to `newsfeed.js`: in order to design the news article better with css, three more class-names were introduced: newsfeed-desc, newsfeed-desc, newsfeed-desc
- Added to `newsfeed.js`: in order to design the news article better with css, three more class-names were introduced: newsfeed-desc, newsfeed-desc, newsfeed-desc

### Updated
- English translation for "Feels" to "Feels like"
- Fixed the example calender url in `config.js.sample`
- Update `ical.js` to solve various calendar issues.
- Update weather city list url [#1676](https://github.com/MichMich/MagicMirror/issues/1676)
- Update weather city list url [#1676](https://github.com/MichMich/MagicMirror/issues/1676)
- Only update clock once per minute when seconds aren't shown

### Fixed
- Fixed uncaught exception, race condition on module update
- Fixed issue [#1696](https://github.com/MichMich/MagicMirror/issues/1696), some ical files start date to not parse to date type
- Fixed uncaught exception, race condition on module update
- Fixed issue [#1696](https://github.com/MichMich/MagicMirror/issues/1696), some ical files start date to not parse to date type
- Allowance HTML5 autoplay-policy (policy is changed from Chrome 66 updates)
- Handle SIGTERM messages
- Fixes sliceMultiDayEvents so it respects maximumNumberOfDays
@@ -1,7 +1,7 @@
The MIT License (MIT)
=====================

Copyright © 2016-2017 Michael Teeuw
Copyright © 2016-2019 Michael Teeuw

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
@@ -130,13 +130,6 @@ if $NPM_INSTALL; then

echo -e "\e[96mInstalling npm ...\e[90m"

# Fetch the latest version of npm from the selected branch
# The NODE_STABLE_BRANCH variable will need to be manually adjusted when a new branch is released. (e.g. 7.x)
# Only tested (stable) versions are recommended as newer versions could break MagicMirror.

#NODE_STABLE_BRANCH="9.x"
#curl -sL https://deb.nodesource.com/setup_$NODE_STABLE_BRANCH | sudo -E bash -
#
sudo apt-get install -y npm
echo -e "\e[92mnpm installation Done!\e[0m"
fi
@@ -203,7 +203,7 @@ var MM = (function() {
*/
var updateModuleContent = function(module, newHeader, newContent) {
var moduleWrapper = document.getElementById(module.identifier);
if (moduleWrapper === null) return;
if (moduleWrapper === null) {return;}
var headerWrapper = moduleWrapper.getElementsByClassName("module-header");
var contentWrapper = moduleWrapper.getElementsByClassName("module-content");

@@ -33,7 +33,7 @@ ical.objectHandlers['RRULE'] = function(val, params, curr, stack, line){
var originalEnd = ical.objectHandlers['END'];
ical.objectHandlers['END'] = function (val, params, curr, stack) {
// Recurrence rules are only valid for VEVENT, VTODO, and VJOURNAL.
// More specifically, we need to filter the VCALENDAR type because we might end up with a defined rrule
// More specifically, we need to filter the VCALENDAR type because we might end up with a defined rrule
// due to the subtypes.
if ((val === "VEVENT") || (val === "VTODO") || (val === "VJOURNAL")) {
if (curr.rrule) {
@@ -41,26 +41,40 @@ Module.register("clock",{

// Schedule update interval.
var self = this;
self.second = 0;
self.minute = 0;
self.lastDisplayedMinute = null;
setInterval(function() {
if (self.config.displaySeconds || self.lastDisplayedMinute !== moment().minute()) {
self.updateDom();
self.second = moment().second();
self.minute = moment().minute();

//Calculate how many ms should pass until next update depending on if seconds is displayed or not
var delayCalculator = function(reducedSeconds) {
if (self.config.displaySeconds) {
return 1000 - moment().milliseconds();
} else {
return ((60 - reducedSeconds) * 1000) - moment().milliseconds();
}
if (self.second === 59) {
self.second = 0;
if (self.minute === 59){
self.minute = 0;
} else {
self.minute++;
};

//A recursive timeout function instead of interval to avoid drifting
var notificationTimer = function() {
self.updateDom();

//If seconds is displayed CLOCK_SECOND-notification should be sent (but not when CLOCK_MINUTE-notification is sent)
if (self.config.displaySeconds) {
self.second = (self.second + 1) % 60;
if (self.second !== 0) {
self.sendNotification("CLOCK_SECOND", self.second);
setTimeout(notificationTimer, delayCalculator(0));
return;
}
self.sendNotification("CLOCK_MINUTE", self.minute);
} else {
self.second++;
self.sendNotification("CLOCK_SECOND", self.second);
}
}, 1000);

//If minute changed or seconds isn't displayed send CLOCK_MINUTE-notification
self.minute = (self.minute + 1) % 60;
self.sendNotification("CLOCK_MINUTE", self.minute);
setTimeout(notificationTimer, delayCalculator(0));
};

//Set the initial timeout with the amount of seconds elapsed as reducedSeconds so it will trigger when the minute changes
setTimeout(notificationTimer, delayCalculator(self.second));

// Set locale.
moment.locale(config.language);
@@ -273,7 +273,7 @@ Module.register("currentweather",{
if (this.config.useLocationAsHeader && this.config.location !== false) {
return this.config.location;
}

return this.data.header;
},

@@ -327,6 +327,11 @@ Module.register("newsfeed",{

self.updateDom(self.config.animationSpeed);

// Broadcast NewsFeed if needed
if (self.config.broadcastNewsFeeds) {
self.sendNotification("NEWS_FEED", {items: self.newsItems});
}

timer = setInterval(function() {
self.activeItem++;
self.updateDom(self.config.animationSpeed);
@@ -10,18 +10,25 @@ module.exports = NodeHelper.create({
config: {},

updateTimer: null,
updateProcessStarted: false,

start: function () {
},

configureModules: function(modules) {

// Push MagicMirror itself , biggest chance it'll show up last in UI and isn't overwritten
// others will be added in front, asynchronously
simpleGits.push({"module": "default", "git": SimpleGit(path.normalize(__dirname + "/../../../"))});

for (moduleName in modules) {
if (defaultModules.indexOf(moduleName) < 0) {
// Default modules are included in the main MagicMirror repo
var moduleFolder = path.normalize(__dirname + "/../../" + moduleName);

var stat;
try {
//console.log("checking git for module="+moduleName)
stat = fs.statSync(path.join(moduleFolder, ".git"));
} catch(err) {
// Error when directory .git doesn't exist
@@ -36,30 +43,29 @@ module.exports = NodeHelper.create({
// No valid remote for folder, skip
return;
}

// Folder has .git and has at least one git remote, watch this folder
simpleGits.push({"module": mn, "git": git});
simpleGits.unshift({"module": mn, "git": git});
});
}(moduleName, moduleFolder);
}
}

// Push MagicMirror itself last, biggest chance it'll show up last in UI and isn't overwritten
simpleGits.push({"module": "default", "git": SimpleGit(path.normalize(__dirname + "/../../../"))});
},

socketNotificationReceived: function (notification, payload) {
if (notification === "CONFIG") {
this.config = payload;
} else if(notification === "MODULES") {
this.configureModules(payload);
this.preformFetch();
// if this is the 1st time thru the update check process
if(this.updateProcessStarted==false ){
this.updateProcessStarted=true;
this.configureModules(payload);
this.preformFetch();
}
}
},

preformFetch() {
var self = this;

simpleGits.forEach(function(sg) {
sg.git.fetch().status(function(err, data) {
data.module = sg.module;

0 comments on commit 500147e

Please sign in to comment.
You can’t perform that action at this time.