Code Monkey home page Code Monkey logo

mmm-kalliope's Introduction

MMM-kalliope

Module to bind Kalliope with your Magic Mirror.

This module allow you to:

  • show what Kalliope say on the screen
  • control your Magic Mirror by sending notification to other active modules

Note: On Kalliope, a neuron is available to talk with this module directly.

Demo

Video demo with sound here

Installation

Clone this repo into ~/MagicMirror/modules directory.

Configure your ~/MagicMirror/config/config.js:

{
    module: "MMM-kalliope",
    position: "upper_third",
    config: {
        title: "Kalliope"
    }
}

Configuration option

Option Default Description
max 5 How many messages should be keept on the screen.
keep_seconds 5 Number of seconds received messages will stay displayed. If set to "0", then message will never be removed
title Kalliope The name placed above received messages

API documentation

POST /kalliope/

Query parameters

Parameter Description
notification The notification identifier. If set to "KALLIOPE", the payload will be printed by the module. In other case the notification is sent to all other modules
payload A notification payload to pass to the module. Can use plain text or JSON.

Curl examples

This command will send a message that will be printed by the MMM-kalliope module

curl -H "Content-Type: application/json" -X POST -d '{"notification":"KALLIOPE", "payload": "my message"}' http://localhost:8080/kalliope

Here the notification is sent to the alert module.

curl -H "Content-Type: application/json" -X POST -d '{"notification":"SHOW_ALERT", "payload": {"title": "mytitle", "message": "this is a test", "timer": 5000}}' http://localhost:8080/kalliope

How to control my MM module from this module

All notifications that are not concerned by this module (when the notification name is not "KALLIOPE") will be send to other installed module on your Magic Mirror.

To add a notification receptor to your module, you just need to implement the notificationReceived method like bellow.

notificationReceived: function(notification, payload){
		....

		if (notification === "NOTIFICAION_NAME" && payload=="bla"){
			// Do some magic here with your module
		}

		if (notification === "NOTIFICAION_NAME" && payload=="blablabla"){
			// Do some magic here with your module
		}

		....
},

mmm-kalliope's People

Contributors

sispheor avatar iennacca avatar

Watchers

James Cloos avatar

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.