This is a module for the MagicMirror².
Simple display of AQI information from World Air Quality Index project. This module will require a free api key from AQICN
In ~/MagicMirror/modules
git clone https://github.com/JHWelch/MMM-AQI.git
Install NPM dependencies
cd MMM-AQI
npm install
To use this module, add the following configuration block to the modules array in the config/config.js
file:
var config = {
modules: [
{
module: 'MMM-AQI',
config: {
// See below for configurable options
}
}
]
}
Option | Required? | Description |
---|---|---|
token |
Required | Free token from AQICN.org |
city |
Required | The city for which to display the information |
colorMode |
Optional | Color mode for the AQI display Default default (color) See |
updateInterval |
Optional | Refresh time in milliseconds Default 60000 milliseconds (1 minute) |
You can update the color mode of the AQI display by setting the colorMode
option. The following options are available:
Option | Description |
---|---|
default |
Default AQI colors. Primary green/red/yellow. |
dimmed |
Dimmed AQI colors. Based on colors used by AQICN |
You can fully customize the colors of the AQI display by overriding the following classes in your custom.css file. See the MMM-AQI.css file for the default values. Make sure to set background-color
and color
to override the default values.
.aqi-label--good { /** set background-color & color */}
.aqi-label--moderate { /** set background-color & color */}
.aqi-label--sensitive { /** set background-color & color */}
.aqi-label--unhealthy { /** set background-color & color */}
.aqi-label--very-unhealthy { /** set background-color & color */}
.aqi-label--hazardous { /** set background-color & color */}
There is a test suite using Jest.
npm test
# Run linting
npm run lint
# Fix linting errors
npm run fix