Giter Club home page Giter Club logo

mmm-simplelogo's Introduction

Module: MMM-SimpleLogo

The MMM-SimpleLogo module is third party modules of the MagicMirror. This module simply displays logo.

Using the module

To use this module, add it to the modules array in the config/config.js file:

modules: [
    {
        module: 'MMM-SimpleLogo',
        position: 'top_left',    // This can be any of the regions.
        config: {
            // The config property is optional.
            // See 'Configuration options' for more information.
        }
    }
]

Configuration options

The following properties can be configured:

Option Description
fileUrl File url.

Possible values: Logo link form internet or path to your local files relative to MagicMirror directory
Default value: 'modules/MMM-SimpleLogo/public/logo.png'
width Set width of your logo, height is auto.

Possible values: '300px' or '50%'
Default value: '200px'
position Horizontal position on current container

Possible values: left, center, or right
Default value: left
refreshInterval Refresh/refetch image file between interval. Only use this if your image url return different image after some interval of time, even the fileUrl is not changed. See this case #2, awesome project by @ElYoM

Possible values: 1000, 2000, or 10000
Default value: 0 (disabled)
text Text above the image.

Possible values: Any text
Default value: Simple Logo

Notification Events

The MMM-SimpleLogo module supports the notification event SIMPLE_LOGO_UPDATE which allows the configuration to be dynamically modified. As an example, the MMM-OnScreenMenu module might be used to dynamic adjust the fileURL parameter as follows:

{
    module: "MMM-OnScreenMenu",
    position: "top_left",
    config: {
        menuItems: {
            notify1: {
                title: "Show Cat",
                notification: "SIMPLE_LOGO_UPDATE",
                payload: {
                    fileUrl: "cat.jpg",
                    width: "750px"
                }
            },
            notify2: {
                title: "Show Dog",
                notification: "SIMPLE_LOGO_UPDATE",
                payload: {
                    fileUrl: "dog.jpg",
                    width: "1050px"
                }
            }
        }
    }
}

mmm-simplelogo's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

mmm-simplelogo's Issues

Custom CSS & Top Text

Hello;

I have been playing with the Top Text and dynamically changing it as well as the images using .../api/notification/SIMPLE_LOGO_UPDATE.... It is all working great!

I would however like to modify the Top Text to be a little larger and perhaps centred. I can't seem to get anything to work using custom.css, it is not referenced at all in the module's css file either. How can I modify this text?

Seeking help with SIMPLE_LOGO_UPDATE

Greetings;

I am attempting to use this module in conjunction with MMM-Remote-Control and CLI commands. I am able to use command line to show and hide the module, and the default graphic I have set up as follows:

`curl "http://192.168.1.200:8080/api/module/:MMM-SimpleLogo/show?apiKey=My_API_key"

curl "http://192.168.1.200:8080/api/module/:MMM-SimpleLogo/hide?apiKey=My_API_key"`

These work fine. I am having problems though sending commands to modify using SIMPLE_LOGO_UPDATE. I am not sure of the construction of the command. The MMM-Remote-Control API specifies the following:

http://localhost:8080/api/module/:moduleName/:action/:p?a=something&b=somethingelse

Sends a notification :action to the module :moduleName with a payload { param: p, a: b, c: d }

I have structured my command as: curl "http://192.168.1.200:8080/api/module/:MMM-SimpleLogo/:SIMPLE_LOGO_UPDATE/:p?fileUrl:'/modules/MMM-ImageSlideshow/on_tap/Pilsner.jpg'&apiKey=My_API_key"

but it throws the following errors:

TypeError: Cannot read properties of undefined (reading &#39;:SIMPLE_LOGO_UPDATE&#39;)<br> &nbsp; &nbsp;at Class.answerModuleApi (/home/pi/MagicMirror/modules/MMM-Remote-Control/API/api.js:406:36)<br> &nbsp; &nbsp;at /home/pi/MagicMirror/modules/MMM-Remote-Control/API/api.js:269:22<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)<br> &nbsp; &nbsp;at next (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:144:13)<br> &nbsp; &nbsp;at Route.dispatch (/home/pi/MagicMirror/node_modules/express/lib/router/route.js:114:3)<br> &nbsp; &nbsp;at Layer.handle [as handle_request] (/home/pi/MagicMirror/node_modules/express/lib/router/layer.js:95:5)<br> &nbsp; &nbsp;at /home/pi/MagicMirror/node_modules/express/lib/router/index.js:284:15<br> &nbsp; &nbsp;at param (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:365:14)<br> &nbsp; &nbsp;at param (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:376:14)<br> &nbsp; &nbsp;at param (/home/pi/MagicMirror/node_modules/express/lib/router/index.js:376:14)

I am not sure what this means, is my command wrong or is there some other issue? Any hints on how I can get this to work properly?

Install

how do i install your module?

feature request: label

i know it's supposed to be a simple logo, but can we have a label please? :D

i was planning on adding a bunch of them to display build-server builds, e.g.: Build Status

Config options don't work

Default logo, width, and position are always used, despite settings in config.js.

Changing "defaults" to "config" worked, but not sure if that's the proper fix. Unpopulated config options remained the default values.

Using Firefox 50.1.0.

config_patch.txt

Add a scheduler

Is it possible to add a scheduler to this based on say a cron schedule so at certain times it shows a specific image from a folder?

"text" config property not in documentation

The "text" property is not in the docs. This results in it defaulting to "Simple Logo", which is displayed above the icon.

I suggest adding this to the config options documentation, as well as implementing an option to not have it display at all.

Yes, it's simple to just comment out the line in the code that adds it to the DOM, but some users may struggle figuring this out.

[Feature Request] Automatic refresh of image when change is detected

Hello,

I am currently using your module and I was wondering if it was possible to implement an automatic image refresh system when a change is detected or after a configurable delay? I ask for this because I generate an image of the sunshine of the Earth using Xplanet every 2 minutes and then I display it using your module and I really want these changes to appear automatically without having to restart the entire MagicMirror application.

Thank you in advance.
2017-02-14_00-27-45

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.