Giter Site home page Giter Site logo

mmm-nhl's Introduction

MMM-NHL GitHub license Build status Code Climate Known Vulnerabilities

National Hockey League Module for MagicMirror²

Examples

Dependencies

Installation

  • Clone this repo into ~/MagicMirror/modules directory.
  • Configure your ~/MagicMirror/config/config.js:
{
    module: 'MMM-NHL',
    position: 'top_right',
    config: {
        // Add your config options here, which have a different value than default.
    }
}
  • Run command npm i --production in ~/MagicMirror/modules/MMM-NHL directory.

Config Options

Option Default Description
colored false Remove black/white filter of logos.
focus_on false Display only matches with teams of this array e.g. ['VAN', 'MTL', 'BOS'].
matches 6 Max number of matches displaying simultaneously.
rotateInterval 20000 (20 secs) How often should be rotated the matches in the list.
reloadInterval 1800000 (30 mins) How often should the data be fetched.
daysInPast 1 How many days should a game be displayed after it is finished.
daysAhead 7 How many days should a game be displayed before it starts.
liveReloadInterval 60000 (1 min) How often should the data be fetched during a live game.
showNames true Should team names be displayed?
showLogos true Should team logos be displayed?
showPlayoffSeries true Should playoff series be displayed (if in playoffs)?
rollOver false Displays today's games and based on game status also yesterdays games or tomorrows games. Automatically overrides daysInPast and daysAhead to 1.

Global config

Option Default Description
locale undefined By default it is using your system settings. You can specify the locale in the global MagicMirror² config. Possible values are for e.g.: 'en-US' or 'de-DE'.

To set a global config you have top set the value in your config.js file inside the MagicMirror² project.

Developer

  • npm run lint - Lints JS and CSS files.
  • npm run docs - Generates documentation.

mmm-nhl's People

Contributors

dannoh avatar fewieden avatar matlem037 avatar parnic avatar timpeer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mmm-nhl's Issues

Problem with All Stars teams

Platform (Hardware/OS):
rasbian/windows

Node version:
v10.15.1

MagicMirror² version:
2.15.0

Module version:
2.3.1

Description of the issue:
Can't handle All Stars teams

initTeams/teamMapping doesn't have all stars team so parseTeam crashes

This fixes actual crashing but not team logos

        if (!team) {
            Log.error('no team given');
            return {};
        }

        return {
            id: team.id,
            name: this.teamMapping[team.id]?.name || team?.abbrev || '-',
            short: this.teamMapping[team.id]?.short || team?.abbrev || '-',
            score: team.score ?? 0
        };
    },```


`
[{"id":7805,"placeName":{"default":"Team King"},"abbrev":"KNG","logo":"https://assets.nhle.com/logos/asw/svg/KNG_light.svg","darkLogo":"https://assets.nhle.com/logos/asw/svg/KNG_dark.svg","awaySplitSquad":false,"radioLink":"https://d2igy0yla8zi0u.cloudfront.net/KNG/20232024/KNG-radio.m3u8"},
{"id":7806,"placeName":{"default":"Team Kloss"},"abbrev":"KLS","logo":"https://assets.nhle.com/logos/asw/svg/KLS_light.svg","darkLogo":"https://assets.nhle.com/logos/asw/svg/KLS_dark.svg","homeSplitSquad":false,"radioLink":"https://d2igy0yla8zi0u.cloudfront.net/KLS/20232024/KLS-radio.m3u8"}]

`

Series table not displaying properly

I don't really know how to use Github, so I'm not sure if this is how I'm supposed to go about this, but I noticed that the table for Series doesn't display properly.

In the file /templates/MMM-NHL.njk
Line 91 should be <td>{{ series.teams.home.score }}</td>
instead of <d>{{ series.teams.home.score }}</td>

focus_on

I am having issues on the syntax for focus_on
if I try to use an array like mentioned My MM has an error.

any examples on how to write the focus_on config?

Update the seasons in a general location.

Platform (Hardware/OS): Raspberry Pi

Node version:

MagicMirror² version:

Module version:

Description of the issue: Unable to use with the current season, I am seeing an undefined season notification when booted up. please help for where to update the season.

Rotating teams

Would it be possible to have a set number of games then it rotate through the list?
MMM-NHL has this avilability config as;
| rotateInterval|20000(20 secs) | How often should be rotated the matches in the list. | |reloadInterval|1800000(30 mins) | How often should the data be fetched. |

Sorry posted on wrong GIT - please remove

Finals with Day / Max number of entries?

Platform (Hardware/OS): Ras Pi

Node version:

MagicMirror² version:

Module version:

Description of the issue: I have 3 teams I am focused on and set the matches as high as 30. daysinpast set to 5 and daysahead set to 15 but at most I am only seeing 7 entries. (5 final and 2 scheduled). am i doing something wrong? should i be seeing more?

and is there a way to display the day of the final scores? Final - Wednesday instead of just Final?

Love the module, thanks for the hard work!

Adding the Golden Knights

It would be very nice if you can add the Vegas Golden Knights.
Thanks for this awesome module. :)

Configuration for time zone within queries

America/Toronto is baked into the file node_helpers.js in 3 places which causes the times to be all wrong for me. I was forced to edit that file and apply my correct time zone.

daysPast / daysAhead (Fun with timezones)

I still don't think this code is correct

        const date = new Date();
        date.setDate(date.getDate() - this.config.daysInPast);
        const startDate = date.toISOString().slice(0, 10);
        date.setDate(date.getDate() + this.config.daysInPast + this.config.daysAhead);
        const endDate = date.toISOString().slice(0, 10);

daysInPast = 1
At 11pm UTC-5 January 25th this code will add a day to make it 26, but then convert it to UTC to make it 27. So you jump 2 days instead of just 1

Playoff series status

I know space is limited in a module, and i don't have a specific idea of where to fit it, but having the up to date games won in a playoff series was something my wife pointed out.

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.