yyrkoon94 / lovelace-idf-mobilite

Lovelace Card for IDF Mobilité (Bus, Métro, RER)
19 stars 7 forks source link

Feature/update ratp database #29

Closed wgrs33 closed 3 months ago

wgrs33 commented 3 months ago

I added a Python script which will update the database and images in this repository automatically. This script is not a part of the card, but of the repository and it must be launched manually. Example:

scripts/update_database.py -m dist/images -o dist/referentiel-des-lignes-filtered.js [ -r dist/referentiel-des-lignes.json ]

The idea is to update the card in a periodical manner (apart from other PRs).

To handle more logically the downloaded files I modified also the card's JS code.

  1. I grouped the files into categories which are related to line's transportmode reported in the database file.
    • The files which are not downloaded by the script are in dist/iamges/general
    • All PNG files are replaced with SVG as they can be easily scaled without any quality loss
    • There are no more icons for buses (except the nightbuses and orly/roissybus); bus icons are generated based on the data provided in the database file (text color and background color)
    • CSS code has been updated to centerline the text and the images
  2. If there is a replacement bus detected for a train line, there is a new option to show it in the RER card (show_replacement_bus); the icon is then changed to from a train to a bus and there is a warning sign before
yyrkoon94 commented 3 months ago

Thanks @wgrs33 ! I will test it and make a new release by the end of the week.

yyrkoon94 commented 3 months ago

Hello,

I'd test this version and make some adjustment on the CSS classes. I was not able for now to launch the update database script (I will test more this week-end). But the rest looks ok so I made a release with that. Thank you again for this refactoring and improvement !!!

wgrs33 commented 3 months ago

Hi @yyrkoon94,

Thanks for correcting the CSS! There is only only thing which I would change is to set width: 80px; in .bus-img. When you use min-width then bus destinations might not be aligned. Btw, why the bus icon is higher than line icon? Is it intentional ?

min-wdth: 62px busscreen_minwidth

width: 80px busscreen_fixed