/* clang-format off */
  
static const char html_confSens_script[] PROGMEM = R"=====(
  function transmit(f) {
    if (!xhttp) {   
    reqTime = 0;
    reqFin = false;
    //updCbxVal(g('togTHdisp'));
    xhttp = new XMLHttpRequest();
    xhttp.timeout = 1000;
    xhttp.overrideMimeType('application/json');
    xhttp.open('POST', 'confDataSens');
    xhttp.send(f ? (new FormData(f)) : '');
    xhttp.onreadystatechange = function () {
      if (xhttp.readyState === XMLHttpRequest.DONE && xhttp.status === 200) {
        var data = JSON.parse(xhttp.responseText);
        selectElement(g('assignSens_0'), data.assignSens_0);
        selectElement(g('assignSens_1'), data.assignSens_1);
        selectElement(g('assignSens_2'), data.assignSens_2);
        g('measInt').value = data.measInt;
        g('DHT_tempCorr').value = data.DHT_tempCorr;
        g('DHT_humCorr').value = data.DHT_humCorr;
        //setCbx(g('togTHdisp'), data.togTHdisp);
        xhttp = null;
        reqFin = true;
       }
       else {
         if(!reqFin && reqTime > 10) {
           xhttp = null;
           reqFin = true;
         }
       }
     }
   }
    return false;
  }
  //transmit();
  function saveConf() {
    //updCbxVal(g('togTHdisp'));
    g('frmConf').submit();
  }
  function init() {
    transmit();
  }
)====="; // html_confSens_script

static const char html_confSens_body_start[] PROGMEM = R"=====(
<b>Konfiguration - Sensoren</b>
<div class='config'>
<form id='frmConf' action='setConfSens' method='POST'>
<br>
<fieldset>
<legend>Intervalle</legend>
<p><b>Messintervall [s]</b><br><input type='number' name='measInt' id='measInt'></p>
</fieldset>
)=====";

#ifdef ENABLE_SENSORS_ONEWIRE
static const char html_confSens_oneWire_start[] PROGMEM = R"=====(
<div></div><br>
<div></div><br>
<fieldset>
<legend>OneWire Temperatursensoren</legend>
<table>
<tr><th>#</th><th>Adresse</th><th>T [°C]</th><th>Zuordnung</th></tr>
)=====";

static const char html_confSens_oneWire_AssignSelector_options[] PROGMEM = R"=====(
  <option value="255">-</option>
  <option value="0">Vorlauf</option>
  <option value="1">R&uuml;cklauf</option>
  <option value="2">Au&szlig;en</option>
)=====";

static const char html_confSens_oneWire_end[] PROGMEM = R"=====(
</table>
</fieldset>
<div></div><br>
)=====";
#endif


#ifdef ENABLE_SENSOR_DHT22
static const char html_confSens_dht[] PROGMEM = R"=====(
<div></div><br>
<fieldset>
<legend>DHT Temperatur- u. Luftfeuchtesensor</legend>
<p><b>Korrekturwert Temperatur [°C] *</b><br><input type='text' name='DHT_tempCorr' id='DHT_tempCorr'></p>
<p><b>Korrekturwert Luftfeuchte [%] *</b><br><input type='text' name='DHT_humCorr' id='DHT_humCorr'></p>
<p class='n'>* wird zum gemessenen Wert addiert. <br>
Kann auch negativ un eine Kommazahl sein. <br>
Zu verwenden, wenn die Messwerte von <br>
einem kalibrierten Sensor abweichen.</p><br>
</fieldset>
)=====";
#endif


static const char html_confSens_body_end[] PROGMEM = R"=====(

<div></div><br>
</form>
<div></div>
<table style='width:100%'>
<td style='width:50%'><button onclick='location="conf";' class='bgrey'>Abbrechen</button></td>
<td style='width:50%'><button onclick='return saveConf()' class='bred'>Speichern</button></td>
</tr></table>
</div>
)====="; // html_confSens_body
