TeraTech / MMM-WiFiPassword

Magic Mirror Module that displays your WiFi network, password with QRCode
MIT License
99 stars 19 forks source link

Display or not the QR code #10

Open borishalleux opened 3 years ago

borishalleux commented 3 years ago

Hello, One feature that I would find interesting is the ability to display or not the QR code. I tried so and it works fine:

In MMM-WiFiPassword.js:

if (this.config.showQR) {
      var qrDiv = document.createElement("div");
      qrDiv.id = "qrdiv";
      qrDiv.className = "qr-image";
      qrDiv.style = "width:" + this.config.qrSize + "px; background-color:" + this.config.colorLight;
      if (this.config.layoutVertical) {
        qrDiv.className += " layout-vertical";
      } else {
        qrDiv.className += " layout-horizontal";
      }  
      div.appendChild(qrDiv);
      }

So we only keep the text, which is sometimes enough.

FR / EN translation by Google, sorry.

TeraTech commented 3 years ago

The variable qrDiv is a fundamental piece of this module. It is used in multiple places throughout the code. What you requested is certainly doable, but will require more testing with the rest of the module before implementing.

Have you tried the change you proposed yourself?

borishalleux commented 3 years ago

Hello,

I made this change in the module on my MagicMirror and everything works impeccably, the QR is not displayed or nothing instead.

But I don't use MMM-MODAL and WIFIPASSWORD_MODAL so I don't know the impact of this change on that.

Binog commented 3 years ago

do have the same problem, have no QR-Code generated and thus not shown up.

Any Idea, I could try?