Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiply configs #51

Open
TimerWolf opened this issue Jan 13, 2020 · 2 comments
Open

Multiply configs #51

TimerWolf opened this issue Jan 13, 2020 · 2 comments

Comments

@TimerWolf
Copy link

TimerWolf commented Jan 13, 2020

It seems like it not possible to have multiply configs, when i have everything in one it seems to work fine, but when i have it separated it seems to be harder for it to work.

And that's a bit fun, as the other starts works as well when everything is in the first one, anyways i could be good whit more then only "one" headline" for the differtent things you will check...

I have try to do it like this

{
      module: 'MMM-NetworkScanner',
      position: 'top_left',
      header: "Network",

      config: {
        devices: [
          {
            macAddress: "1a:1b:1c:1a:1b:1c",
            name: "Desktop",
            icon: "desktop"
          },
          {
            macAddress: "2a:2b:2c:2a:2b:2c",
            name: "Server",
            icon: "server"
          },
        ],

        showUnknown: false,
        showOffline: true,
        showLastSeen: true,
        showLastSeenWhenOffline: true,
        keepAlive: 300,
        updateInterval: 5
      }
    },

    {
      module: 'MMM-NetworkScanner',
      position: 'top_left',
      header: "Phones",

      config: {
        devices: [
          {
            macAddress: "3a:3b:3c:3a:3b:3c",
            name: "Me",
            icon: "mobile"
          },
          {
            macAddress: "4a:4b:4c:4a:4b:4c",
            name: "Other",
            icon: "mobile"
          },
        ],

        showUnknown: false,
        showOffline: true,
        showLastSeen: true,
        showLastSeenWhenOffline: true,
        keepAlive: 300,
        updateInterval: 5,
        sort: false
      }
    },

And if i change the two mac-adresses from the "Phones" to the "Network", both starts to work just fine....

@TimerWolf
Copy link
Author

TimerWolf commented Jan 13, 2020

I am far from an expert on this, but i found a workaround for this problem

By modify the code in "MMM-NetworkScanner.js" and add three lines of code

updateInterval: 20
hide: false, // <- This line is added
sort: true,

And then add fallowing code

getDom: function() {
  var self = this;

  if (self.config.hide) { // <- This line is added
    this.style.display = "none"; // <- This line is added
  } // <- This line is added

And then do the config in the following way

    // MMM-NetworkScanner

    {
      module: 'MMM-NetworkScanner',
      position: 'top_left',
      header: "Dummy",

      config: {
        devices: [

          // Network
          {
            macAddress: "1a:1b:1c:1a:1b:1c",
            name: "Desktop",
            icon: "desktop"
          },
          {
            macAddress: "2a:2b:2c:2a:2b:2c",
            name: "Server",
            icon: "server"
          },

          // Phone
          {
            macAddress: "3a:3b:3c:3a:3b:3c",
            name: "Me",
            icon: "mobile"
          },
          {
            macAddress: "4a:4b:4c:4a:4b:4c",
            name: "Other",
            icon: "mobile"
          },
        ],

        showUnknown: false,
        showOffline: true,
        showLastSeen: true,
        showLastSeenWhenOffline: true,
        keepAlive: 300,
        updateInterval: 5,
        hide: true
      }
    },
    
    {
      module: 'MMM-NetworkScanner',
      position: 'top_left',
      header: "Network",

      config: {
        devices: [
          {
            macAddress: "1a:1b:1c:1a:1b:1c",
            name: "Desktop",
            icon: "desktop"
          },
          {
            macAddress: "2a:2b:2c:2a:2b:2c",
            name: "Server",
            icon: "server"
          },
        ],

        showUnknown: false,
        showOffline: true,
        showLastSeen: true,
        showLastSeenWhenOffline: true,
        keepAlive: 300,
        updateInterval: 5
      }
    },

    {
      module: 'MMM-NetworkScanner',
      position: 'top_left',
      header: "Phones",

      config: {
        devices: [
          {
            macAddress: "3a:3b:3c:3a:3b:3c",
            name: "Me",
            icon: "mobile"
          },
          {
            macAddress: "4a:4b:4c:4a:4b:4c",
            name: "Other",
            icon: "mobile"
          },
        ],

        showUnknown: false,
        showOffline: true,
        showLastSeen: true,
        showLastSeenWhenOffline: true,
        keepAlive: 300,
        updateInterval: 5,
        sort: false
      }
    },

Then it actually work as expected, hopefully someone come whit a better solution then this but it has to work for now!

@The-Exterminator
Copy link

The-Exterminator commented Jan 14, 2021

@TimerWolf
Nice work, but it will not update after the line

        showUnknown: false,
        showOffline: true,
        showLastSeen: true,
        showLastSeenWhenOffline: true,
        keepAlive: 300,
        updateInterval: 5,
        hide: true
      }'

Can you please take a look on it. ???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants