Giter Club home page Giter Club logo

mmm-aqi's Introduction

MMM-AQI

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

Installation

In ~/MagicMirror/modules

git clone https://github.com/JHWelch/MMM-AQI.git

Install NPM dependencies

cd MMM-AQI
npm install

Using the module

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
            }
        }
    ]
}

Configuration 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)

Colors

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

Custom Colors

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 */}

Development

Testing

There is a test suite using Jest.

npm test

Linting

# Run linting
npm run lint

# Fix linting errors
npm run fix

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.