The dashboard is ever-increasingly awesome! Two quick suggestion / feature requests related to the “hooks” at the bottom for user modification:
First: It would be helpful from a CSS styling standpoint if the actual name of the device itself was added as a class to the containing div. I’ve been able to approximate this by adding something like the following to the top of renderTile():
if (data.name != null) {
data.normalizedName = data.name.replaceAll(/[^a-zA-Z0-9]/, "_")
} else {
data.normalizedName = ""
}
… and then adding data.normalizedName into the list of class names that get applied to each tile when they render. The need for this change may be lessened if/when grouping becomes available (if the groups can be individually styled) … but this facility would make it a lot easier (for me, at least) to use the customCSS hook to mess with some individual tiles (color coding and whatnot).
Second: I’ve been adding some pretty-printing of my device names so that they look less like my own “internal” naming scheme, which is mostly set up so that I can efficiently pick things from inside the ST mobile app, and render them in a more “dashboard friendly” manner.
So, for example, I have devices named things like “_vs SCENE 1FL All On”, which happens to be a virtual switch that triggers a scene. I am using a bunch of regular expressions in the Dashboard code to transform that into something a little more user-friendly like “Trigger: 1st Floor All On”.
The actual naming convention I’m using is (of course) custom to my own setup, but – if others would find something like this useful – it would be awesome to have a persistent hook (similar to the customCSS( ) hook) for the beautification of device names. I’ve approximated this myself by adding a line like
data.name = prettyName(data.name)
to the top of renderTile, after the above code, and then adding all my renaming code to that function at the end of the file, so that it’s easier to migrate.
Anyway, I thought that might be of some use to others (and it would prevent my needing to track down and edit renderTile with each revision
)
Thanks again for a game-changing app!