From 9355da603ae05b16d48746e14f10e69b4ae7433c Mon Sep 17 00:00:00 2001 From: naveda89 Date: Tue, 3 Nov 2020 22:38:42 +0100 Subject: [PATCH 1/2] Add support for special Brand icons (fontawesome) --- MMM-NetworkScanner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MMM-NetworkScanner.js b/MMM-NetworkScanner.js index 4b26e0f..5ea28ef 100644 --- a/MMM-NetworkScanner.js +++ b/MMM-NetworkScanner.js @@ -197,7 +197,7 @@ Module.register("MMM-NetworkScanner", { var deviceCell = document.createElement("td"); deviceCell.classList.add("device"); var icon = document.createElement("i"); - icon.classList.add("fa", "fa-fw", "fa-" + device.icon); + icon.classList.add(device.iconPrefix || "fa", "fa-fw", "fa-" + device.icon); if (self.config.colored) { icon.style.cssText = "color: " + device.color; From ad42ef351751c001ba3df45bd8060d9853a0c08a Mon Sep 17 00:00:00 2001 From: naveda89 Date: Tue, 3 Nov 2020 22:45:30 +0100 Subject: [PATCH 2/2] Update README to include iconPrefix option for device objects --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index a5d2ab7..962d2a3 100644 --- a/README.md +++ b/README.md @@ -73,6 +73,7 @@ The device object contains information about the devices to be found on the netw | `ipAddress` | `optional` the IP address **or** host name of the device. | `192.168.0.1` or `github.com` | | `name` | `optional` the friendly name for the device. If omitted, the `macAddress` or `ipAddress` will be used. | `Phone` or `Router` | | `icon` | `optional` the symbol to show next to the device. See [Font Awesome](http://fontawesome.io/cheatsheet/) cheatsheet. If omitted, `question` will be used. | There are a huge number of icons to choose from. Here are some examples: `globe`, `server`, `desktop`, `laptop`, `mobile`, `wifi`. | +| `iconPrefix` | `optional` the prefix related to the selected `icon` to show next to the device. See [Font Awesome v4 to v5 changes](https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#changes). If omitted, `fa` will be used. | The free options to be used are: `fa` or `fas` (which are equivalent), and `fab` for branded icons. | | `color` | `optional` the color the device should be display with. | `#ff0000` for red | **Note** A device object should only contain either a `macAddress` *or* an `ipAddress` **NOT** both.