     @reconnect delay
     @reconnectAttempt += 1
 
-    @elements.led.dataset.state = "pending"
+    setElDataAttr @elements.led "state", "pending"
 
     unless @display["hideOnError"]
       @setVisibility "visible"

  setElHTML = (el, html) ->
    el.innerHTML = html

  toLocaleStringSupportsLocales = ->
    try new Date().toLocaleString "i"
    catch e then return e instanceof RangeError

        e.preventDefault()
        e.stopPropagation()
        state = (@elements.pane.dataset.open == "false")
        setElDataAttr @elements.pane, "open", state
      , false

      @elements.pane.addEventListener "click", (e) -> e.stopPropagation()

      document.addEventListener "click", (e) =>
        if @elements.pane.dataset.open
          setElDataAttr @elements.pane, "open", false
      , false

  setVisibility: (visibility) ->
