@lschip said in control visibility via device status:
Now we are a few versions further, is there anything to make this easyer in the latest versions?
Yes, indeed. The
<li> DOM node for a device view now has the
id attribute set to the device id. So, the following should work for a device with device id “bridge-light”:
then set css "display" of "#bridge-light" to "none"
EDIT: There is a caveat, however. If the device is shown on multiple pages the view is only changed on the first page! The reason is that DOM ids are considered to be unique, and thus,
#id only selects the first match. I will make sure the page-id will be added to one of the superior
<div> nodes. This way it will be possible to hide an element on a given page, e.g.
set css "display" of "#page2 #bridge-light" to "none"
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law