view service/rdf_to_mqtt/index.html @ 1566:de145b8129d8

rename living lamps Ignore-this: 4ccc9c8869cb489d89f5d19da475db69 darcs-hash:0129999f21b383780a12f20975984306186fda90
author drewp <drewp@bigasterisk.com>
date Fri, 27 Mar 2020 23:07:10 -0700
parents 71eec31da919
children
line wrap: on
line source

<!doctype html>
<html>
  <head>
    <title>rdf_to_mqtt</title>
    <meta charset="utf-8">
    <script src="/lib/polymer/1.0.9/webcomponentsjs/webcomponents.min.js"></script>
    <script src="/lib/require/require-2.3.3.js"></script>
    <script src="/rdf/common_paths_and_ns.js"></script>

    <link rel="stylesheet" href="/rdf/browse/style.css">

  </head>
  <body class="rdfBrowsePage">
    rdf_to_mqtt


    <p>Send demo statements to bridge:</p>
    <div><button data-post="output?s=:kitchenLight&p=:brightness" data-body="0.0">Send (:kitchenLight :brightness 0.0)</button></div>
    <div><button data-post="output?s=:kitchenLight&p=:brightness" data-body="1.0">Send (:kitchenLight :brightness 1.0)</button></div>
    <div><button data-post="output?s=:kitchenCounterLight&p=:brightness" data-body="0.0">Send (:kitchenCounterLight :brightness 0.0)</button></div>
    <div><button data-post="output?s=:kitchenCounterLight&p=:brightness" data-body="1.0">Send (:kitchenCounterLight :brightness 1.0)</button></div>
    <div><button data-post="output?s=:livingLampShelf&p=:brightness" data-body="0.0">Send (:livingLampShelf :brightness 0.0)</button></div>
    <div><button data-post="output?s=:livingLampShelf&p=:brightness" data-body="1.0">Send (:livingLampShelf :brightness 1.0)</button></div>
    <div><button data-post="output?s=:livingLampMantleEntry&p=:brightness" data-body="0.0">Send (:livingLamp1 :brightness 0.0)</button></div>
    <div><button data-post="output?s=:livingLampMantleEntry&p=:brightness" data-body="1.0">Send (:livingLamp1 :brightness 1.0)</button></div>
    <div><button data-post="output?s=:livingLampMantleChair&p=:brightness" data-body="0.0">Send (:livingLamp2 :brightness 0.0)</button></div>
    <div><button data-post="output?s=:livingLampMantleChair&p=:brightness" data-body="1.0">Send (:livingLamp2 :brightness 1.0)</button></div>
    <div><button data-post="output?s=:livingLampToyShelf&p=:brightness" data-body="0.0">Send (:livingLamp3 :brightness 0.0)</button></div>
    <div><button data-post="output?s=:livingLampToyShelf&p=:brightness" data-body="1.0">Send (:livingLamp3 :brightness 1.0)</button></div>
    <div><button data-post="output?s=:livingLampPiano&p=:brightness" data-body="0.0">Send (:livingLamp4 :brightness 0.0)</button></div>
    <div><button data-post="output?s=:livingLampPiano&p=:brightness" data-body="1.0">Send (:livingLamp4 :brightness 1.0)</button></div>

    <div><button data-post="output?s=:theater&p=:inputSelector" data-body="bd">Theater to chromecast</button></div>
    <div><button data-post="output?s=:theater&p=:inputSelector" data-body="game">Theater to PS4</button></div>
    <div><button data-post="output?s=:theater&p=:inputSelector" data-body="pc">Theater to VR</button></div>
    <div><button data-post="output?s=:theater&p=:inputSelector" data-body="cbl">Theater to PS3</button></div>
    <div><button data-post="output?s=:theater&p=:volumeChange" data-body="3">Theater volume up</button></div>
    <div><button data-post="output?s=:theater&p=:volumeChange" data-body="-3">Theater volume down</button></div>

    <script>
     Array.from(document.querySelectorAll("button")).forEach((el) => {
       el.addEventListener("click", (ev) => {
         fetch(el.dataset.post, {
           method: "PUT",
           body: el.dataset.body
         });
       });
     });
    </script>

      <div class="served-resources">
        <a href="stats/">/stats/</a>
        <a href="output">/output (post)</a>
      </div>
  </body>
</html>