Alvinger / MMM-ResRobot

ResRobot module for Magic Mirror 2 - Display public transport departures
13 stars 14 forks source link

Differentiate between types of buses #15

Closed lord-chefren closed 3 years ago

lord-chefren commented 3 years ago

I'm just curious if there's a possibility to differentiate between regional buses and city buses. As it is commuter traffic i Region Skåne (Sweden) is closely associated with the color schemes (green is city buses, yellow is regional buses and purple for the trains). The color is only astethics but would be nice to get correct. More than that it would be nice to be able to show only city or regional buses.

Possibilitys and options?

Just made my MM and this module have been performing really well. Big thanks

Alvinger commented 3 years ago

I'm just curious if there's a possibility to differentiate between regional buses and city buses. As it is commuter traffic i Region Skåne (Sweden) is closely associated with the color schemes (green is city buses, yellow is regional buses and purple for the trains). The color is only astethics but would be nice to get correct. More than that it would be nice to be able to show only city or regional buses.

Possibilitys and options?

Just made my MM and this module have been performing really well. Big thanks

@lord-chefren Thank you! I kept it simple and only took the first character of transportationType into account but it would be fairly simple to add logic that will use all the characters. One would need to expand iconTable and colorTable as well. Let me see what I can do. Do you have a good "siteid" (station/stop) to use for testing?

Alvinger commented 3 years ago

In the documentation for ResRobot Stolphållplatser 2 there are only examples of category (CatOutS) values. There seems to be only two codes: BLT (Buss Länstrafik) och BEX (Buss Express). I will make a simple change that will allow you to use different colors by changing colorTable. The choices you will have is either use the full code (e.g. BLT) as the color key or use just the first character (current behavior). This way you can set the color for BLT to the correct color for länsbussar and the color for B to the correct color for other buses.

Alvinger commented 3 years ago

@lord-chefren I've pushed a new version. Try adding an entry for "BLT" in colorTable.