Skip to content

Commit 0e79d8e

Browse files
authored
Merge pull request #307 from khassel/mm_fixes
fix needed for new MagicMirror² version `v2.29.0`
2 parents fb20bd4 + 72be039 commit 0e79d8e

File tree

6 files changed

+23
-19
lines changed

6 files changed

+23
-19
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MagicMirror² Module: Remote Control w/ RESTful API
22

3-
This module for the [MagicMirror²](https://github.com/MichMich/MagicMirror) allows you to quickly shutdown your mirror through a web browser.
3+
This module for the [MagicMirror²](https://github.com/MagicMirrorOrg/MagicMirror) allows you to quickly shutdown your mirror through a web browser.
44
The website should work fine on any device (desktop, smart phone, tablet, ...).
55
Since we all want our [SD cards to live a long and prosper life](http://raspberrypi.stackexchange.com/a/383) we properly shut down before pulling the power plug everytime, am I right?
66
Additionally you can hide and show modules on your mirror and do other cool stuff.
@@ -15,7 +15,7 @@ Additionally you can hide and show modules on your mirror and do other cool stuf
1515

1616
### Quick install
1717

18-
If you followed the default installation instructions for the [MagicMirror²](https://github.com/MichMich/MagicMirror) project, you should be able to use the automatic installer.
18+
If you followed the default installation instructions for the [MagicMirror²](https://github.com/MagicMirrorOrg/MagicMirror) project, you should be able to use the automatic installer.
1919
The following command will download the installer and execute it:
2020

2121
```bash
@@ -54,7 +54,7 @@ npm install
5454
```
5555

5656
- (3) For security reasons, the MagicMirror² (and therefore the Remote Control) is *not* reachable externally.
57-
To change this, configure `address`, and `ipWhitelist` in your `config.js` (see [these lines in the sample config](https://github.com/MichMich/MagicMirror/blob/master/config/config.js.sample#L12-L22)).
57+
To change this, configure `address`, and `ipWhitelist` in your `config.js` (see [these lines in the sample config](https://github.com/MagicMirrorOrg/MagicMirror/blob/master/config/config.js.sample#L12-L22)).
5858
For example change `address` to `0.0.0.0` and add two allowed devices with IP-Adresses `192.168.0.42` and `192.168.0.50`:
5959

6060
```js
@@ -200,7 +200,7 @@ The response will be in the JSON format, here is an example:
200200
"moduleData":[
201201
{"hidden":false,"name":"alert","identifier":"module_0_alert"},
202202
{"hidden":true,"name":"clock","identifier":"module_1_clock","position":"bottom_right"},
203-
{"hidden":false,"name":"currentweather","identifier":"module_2_currentweather","position":"top_right"}
203+
{"hidden":false,"name":"weather","identifier":"module_2_weather","position":"top_right"}
204204
],
205205
"brightness":40,
206206
"settingsVersion":1

installer.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ MM_HOME=$HOME/MagicMirror
3737
MODULE_NAME=MMM-Remote-Control
3838
FORK=Jopyth
3939

40-
# check if we are correct by searching for https://github.com/MichMich/MagicMirror in package.json
41-
TEST_STRING="\"url\": \"git+https://github.com/MichMich/MagicMirror.git\""
40+
# check if we are correct by searching for https://github.com/MagicMirrorOrg/MagicMirror in package.json
41+
TEST_STRING="\"url\": \"git+https://github.com/MagicMirrorOrg/MagicMirror.git\""
4242
if grep -sq "$TEST_STRING" "$MM_HOME/package.json"; then
4343
# we found it
4444
echo -n ""

modules.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@
11241124
"id": "sebastianhodapp/MMM-IndoorTemp",
11251125
"url": "https://github.com/sebastianhodapp/MMM-IndoorTemp",
11261126
"author": "sebastianhodapp",
1127-
"desc": "The module emits the notification \"INDOOR_TEMPERATURE\" to display the indoor temperature received via a subscribed MQTT topic in the default [Current Weather module](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/currentweather)."
1127+
"desc": "The module emits the notification \"INDOOR_TEMPERATURE\" to display the indoor temperature received via a subscribed MQTT topic in the default [Weather module](https://github.com/MichMich/MagicMirror/tree/develop/modules/default/weather)."
11281128
},
11291129
{
11301130
"longname": "MMM-meteoblueCurrent",

node_helper.js

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const bodyParser = require("body-parser");
1919
const express = require("express");
2020
const _ = require("lodash");
2121

22-
var defaultModules = require(path.resolve(__dirname + "/../default/defaultmodules.js"));
22+
var defaultModules = require(path.resolve(__dirname + "/../../modules/default/defaultmodules.js"));
2323

2424
Module = {
2525
configDefaults: {},
@@ -95,7 +95,7 @@ module.exports = NodeHelper.create(Object.assign({
9595
},
9696

9797
combineConfig() {
98-
// function copied from MichMich (MIT)
98+
// function copied from MagicMirrorOrg (MIT)
9999
var defaults = require(__dirname + "/../../js/defaults.js");
100100
var configFilename = path.resolve(__dirname + "/../../config/config.js");
101101
if (typeof(global.configuration_file) !== "undefined") {
@@ -215,13 +215,13 @@ module.exports = NodeHelper.create(Object.assign({
215215
name: self.capitalizeFirst(defaultModules[i]),
216216
isDefaultModule: true,
217217
installed: true,
218-
author: "MichMich",
218+
author: "MagicMirrorOrg",
219219
desc: "",
220-
id: "MichMich/MagicMirror",
221-
url: "https://github.com/MichMich/MagicMirror/wiki/MagicMirror%C2%B2-Modules#default-modules"
220+
id: "MagicMirrorOrg/MagicMirror",
221+
url: "https://docs.magicmirror.builders/modules/introduction.html"
222222
});
223223
var module = self.modulesAvailable[self.modulesAvailable.length - 1];
224-
var modulePath = self.configOnHd.paths.modules + "/default/" + defaultModules[i];
224+
var modulePath = "modules/default/" + defaultModules[i];
225225
self.loadModuleDefaultConfig(module, modulePath, i === defaultModules.length-1);
226226
}
227227

@@ -235,10 +235,14 @@ module.exports = NodeHelper.create(Object.assign({
235235
});
236236
},
237237

238+
getModuleDir() {
239+
return this.configOnHd.foreignModulesDir ? this.configOnHd.foreignModulesDir : (this.configOnHd.paths ? this.configOnHd.paths.modules : "modules");
240+
},
241+
238242
addModule(folderName, lastOne) {
239243
var self = this;
240244

241-
var modulePath = this.configOnHd.paths.modules + "/" + folderName;
245+
var modulePath = this.getModuleDir() + "/" + folderName;
242246
fs.stat(modulePath, (err, stats) => {
243247
if (stats.isDirectory()) {
244248
var isInList = false;
@@ -307,7 +311,7 @@ module.exports = NodeHelper.create(Object.assign({
307311
},
308312

309313
loadModuleDefaultConfig(module, modulePath, lastOne) {
310-
// function copied from MichMich (MIT)
314+
// function copied from MagicMirrorOrg (MIT)
311315
var filename = path.resolve(modulePath + "/" + module.longname + ".js");
312316
try {
313317
fs.accessSync(filename, fs.F_OK);
@@ -335,12 +339,12 @@ module.exports = NodeHelper.create(Object.assign({
335339
if (error) {
336340
Log.error(error);
337341
}
338-
res.writeHead(302, { 'Location': "https://github.com/MichMich/MagicMirror/tree/" + result.trim() + "/modules/default/" + query.module });
342+
res.writeHead(302, { 'Location': "https://github.com/MagicMirrorOrg/MagicMirror/tree/" + result.trim() + "/modules/default/" + query.module });
339343
res.end();
340344
});
341345
return;
342346
}
343-
var modulePath = this.configOnHd.paths.modules + "/" + query.module;
347+
var modulePath = this.getModuleDir() + "/" + query.module;
344348
let git = simpleGit(modulePath);
345349
git.getRemotes(true, function(error, result) {
346350
if (error) {

scripts/download_modules.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const util = require("util");
2020
var downloadModules = {
2121
defaults: {
2222
modulesFile: path.resolve(__dirname, "../modules.json"), // Path to modules file
23-
sourceUrl: 'https://raw.githubusercontent.com/wiki/MichMich/MagicMirror/3rd-Party-Modules.md', // Source url
23+
sourceUrl: 'https://raw.githubusercontent.com/wiki/MagicMirrorOrg/MagicMirror/3rd-Party-Modules.md', // Source url
2424
refreshRate: 24 * 3600, // Max Refresh of One Day
2525
force: false, // Force the update
2626
callback: function(result) { console.log(result); } // Callback to run on success or failure

scripts/download_modules.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def main(args):
7171

7272
if __name__ == "__main__":
7373
parser = argparse.ArgumentParser(description='command line utility to download current modules')
74-
parser.add_argument('-u', '--url', nargs='?', default='https://raw.githubusercontent.com/wiki/michmich/MagicMirror/MagicMirror%C2%B2-Modules.md', help='url to extract modules from')
74+
parser.add_argument('-u', '--url', nargs='?', default='https://raw.githubusercontent.com/wiki/MagicMirrorOrg/MagicMirror/3rd-Party-Modules.md', help='url to extract modules from')
7575
parser.add_argument('-o', '--outfile', nargs='?', type=argparse.FileType('w'), default=sys.stdout, help='write output to a file (default stdout)')
7676
args = parser.parse_args()
7777

0 commit comments

Comments
 (0)