lovelace-wallpanel
lovelace-wallpanel copied to clipboard
Added new option disable_screensaver_on_browser_mod_popup_func
Added new option disable_screensaver_on_browser_mod_popup_func
that allows a js condition to be passed to decide whether to disable the screensaver or not, based on the active browser mod popup.
In the below example, i'm using it to only disable the screensaver if there is a webrtc-camera
card in the popup. The bmp
variable is pre-assigned the browser mod popup element, ready to use.
disable_screensaver_on_browser_mod_popup_func: |
let elements = bmp.shadowRoot.querySelector(".container").children;
return Array.from(elements).some(n => n.nodeName.toLowerCase() === "webrtc-camera");
Please let me know what you think?
Thanks