MMM-EarthquakeAlerts is a module for MagicMirror². It posts alert messages to your MagicMirror regarding recent earthquakes based on USGS data.
The module is set up to show:
- Quakes of at least 2.5 magnitude within 10 miles,
- Quakes of at least 4.0 magnitude within 60 miles,
- Quakes of at least 5.5 magnitude within 300 miles, and
- Quakes of at least 7.0 magnitude worldwide
This should roughly equate to quakes that can be felt at the given location (plus major worldwide quakes). I may allow customizing these values through config, but for now that seems to convoluted.
Suggestions are welcome.
cd ~/MagicMirror/modules
git clone https://github.com/dathbe/MMM-EarthquakeAlerts
cd ~/MagicMirror/modules/MMM-EarthquakeAlerts
npm install --omit=devDependencies:
cd ~/MagicMirror/modules/MMM-EarthquakeAlerts
git pull
npm install --omit=devTo use this module, add it to the modules array in your ~/MagicMirror/config/config.js file:
{
module: 'MMM-EarthquakeAlerts',
position: 'top_bar',
config: {
locations: [
{latitude: 39.1, longitude: -94.6, name: 'home'},
{latitude: 46.2, longitude: 6.13, name: 'mom'},
],
}
},You should list your most important location first because the module looks through the locations in order and returns a result on the first distance/magnitude match.
The following properties can be configured:
| Option | Description |
|---|---|
locations |
Technically optional, but not very useful without putting in at least one location you are interested in getting alerts on. Type: array of dictsDefault: [{ latitude: 39.1, longitude: -94.6, name: 'nowhere specific' }] |
updateInterval |
Optional The time between refreshes of quake information in seconds Type: intDefault: 30 * 60 (30 minutes) |
animationSpeed |
Optional The speed of animated transitions from one message to another in milliseconds Type: intDefault: 2000 (2 seconds) |
If you find any problems, bugs or have questions, please open a GitHub issue in this repository.
Pull requests are of course also very welcome 🙂
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
You will need to first install the dev dependencies:
cd ~/MagicMirror/modules/MMM-EarthquakeAlerts
git switch development
npm installPlease create all PRs against the development branch for testing and eventual merging into master.
node --run lint- Run linting checks.node --run lint:fix- Fix automatically fixable linting errors.
This project is licensed under the MIT License - see the LICENSE file for details.
