Elaniobro / MMM-nyc-transit

MTA transit module for Magic Mirror
MIT License
21 stars 14 forks source link

Support multiple instances of MMM-nyc-transit with different configurations #62

Closed joolean closed 2 years ago

joolean commented 2 years ago

This patch allows multiple instances of MMM-nyc-transit to coexist within the same MagicMirror config such that each instance will only update if it receives a socket notification that includes data about the stations the instance is tracking. Without this change, different instances will receive each others' notifications and update incorrectly.

Elaniobro commented 2 years ago

@joolean thank you for the pull request. Help me understand the need for having multiple instances of the module running on the mirror.

The module currently allows the end user to track multiple stations within a single module instance.

joolean commented 2 years ago

Hey @Elaniobro. I'm designing a dashboard and wanted to see arrival times for a single station in each panel. Just feels easier for me to read, personally. That's all!

Elaniobro commented 2 years ago

Thank you for the quick reply @joolean, but can you share a bit more details on this "dashboard" you are desigining?

There are currently two views: list & marquee for this module. I think if you are wanting to have a dashboard view you could get away with just using CSS to style the module to appear as such.

joolean commented 2 years ago

Sure. It's for a Raspberry Pi display that I want to use to help plan my morning commute. I live near three subway stations, and I want to be able to see the arrival timetable for each station (formatted like the overhead arrival display in the monitors at the stations themselves) so I can choose which station to walk to. I've got three panels (top_left, top_center, top_right) each with an instance of MMM-nyc-transit configured for list view with a single station.

Elaniobro commented 2 years ago

Gotcha. For my own edification, have you tried using just one of the 3 locations you mentioned and applied the appropriate css grid techniques?

I am wanting to understand the limitations and issues, if any, you have encountered during your development of your dashboard.

joolean commented 2 years ago

I have not. I will try later today and update this thread!

joolean commented 2 years ago

Having experimented with configuring multiple stations in a single instance of the module and exploring the DOM, I can't see how I would break out the stations and separate them visually in CSS. In fact, I don't think there's any indication of station in the resulting DOM - it looks as if the effect of configuring multiple stations is merely to request more data, and then the response data is just aggregated together uniformly.

So the motivation for my pull request stands!

Elaniobro commented 2 years ago

@all-contributors please add @joolean for code

allcontributors[bot] commented 2 years ago

@Elaniobro

This project's configuration file has malformed JSON: .all-contributorsrc. Error:: Unexpected token } in JSON at position 1699