lovelace-wallpanel icon indicating copy to clipboard operation
lovelace-wallpanel copied to clipboard

Added new option disable_screensaver_on_browser_mod_popup_func

Open codemunkie15 opened this issue 4 months ago • 0 comments

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

codemunkie15 avatar Oct 24 '24 12:10 codemunkie15