MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    Please **review** my code, since I lack experience - mmm_velib, A module for bike sharing schemes in Europe

    Scheduled Pinned Locked Moved Development
    9 Posts 4 Posters 4.6k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P Offline
      poutr
      last edited by

      Ok, I have done the code clean up.

      I use this call below to get the property value and not the propetry name, e.g. to get “Vélib’” and not “PARIS”. Am I right ?

      var contractName = this.stationsData[0].contract_name.toUpperCase();
      if (this.contractList.hasOwnProperty(contractName)) {
      	marque = this.contractList[contractName];
      }
      

      If there is no other issues spotted, that’s great :)

      Stupid question : how does one update his 3rd party module from github ? I used git clone https://github.com/Name/repo to install it on my mirror, but I don’t get how to update locally when the master on github is updated. Fetch failed me (no commit in common or something). I deleted and clone again but that’s so ugly.

      1 Reply Last reply Reply Quote 0
      • yawnsY Offline
        yawns Moderator
        last edited by

        Enter your module folder:

        git pull origin master
        
        P 1 Reply Last reply Reply Quote 0
        • P Offline
          poutr @yawns
          last edited by

          @yawns ty, i will try it !

          1 Reply Last reply Reply Quote 0
          • B Offline
            Brice
            last edited by Brice

            Suggestions :

            • format header correctly (class name = module-header)
            • remove station number from name
              Great module btw !
            P 1 Reply Last reply Reply Quote 0
            • P Offline
              poutr @Brice
              last edited by

              @Brice Thanks!

              ok for the format, will do that.

              I am uneasy about removing the number from the name :

              • It comes as it from the JCDecaux server. Any parsing from my part would be under risk from future modifications.
              • The number is the ID, it feels more precise than a ‘name’.

              I would need more users’ feedback for this point but with a grand total of one user ‘me’, I think I will let it like this, don’t you agree?

              cheers

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy