<commit_before><script type="text/x-red" data-template-name="ramp-thermostat">
    <div class="form-row">
        <label for="node-input-profile"><i class="fa fa-line-chart"></i> Profile</label>
        <input type="text" id="node-input-profile">
    </div>
    <div class="form-row">
        <label for="node-input-hysteresisplus"><i class="fa fa-arrows-v"></i> Hysteresis [+]</label>
        <input type="text" id="node-input-hysteresisplus" style="width:50px">
    </div>
    <div class="form-row">
        <label for="node-input-hysteresisminus"><i class="fa fa-arrows-v"></i> Hysteresis [-]</label>
        <input type="text" id="node-input-hysteresisminus" style="width:50px">
    </div>
    <div class="form-row">
        <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
        <input type="text" id="node-input-name" placeholder="Name">
    </div>
    <div class="form-tips"><span>The Hysteresis is used to prevent osciliation. The [+] value is added to the target and the [-] (absolute) value is subtracted from the target. Within this neutral zone no action accurs.</span>
    </div>
</script>

<script type="text/x-red" data-help-name="ramp-thermostat">
    <p>A node that emulates a thermostat.</p>
    <p>The ramp-thermostat controls an actuator depending on the current input temperature and the target temperature.</p>
        
    <h3>Inputs</h3>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">number</span>
        </dt>
        <dd> current temperature</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setCurrent (or undefined)</dd>
      </dl>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">number</span>
        </dt>
        <dd> target temperature</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setTarget</dd>
      </dl>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">number</span>
        </dt>
        <dd> hysteresis [+]</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setHysteresisPlus</dd>
      </dl>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">number</span>
        </dt>
        <dd> hysteresis [-]</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setHysteresisMinus</dd>
      </dl>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">string</span>
        </dt>
        <dd> profile name</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setProfile</dd>
      </dl>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">object</span>
        </dt>
        <dd> JSON e.g. {"name":"myGreatProfile","points":{"00:00":16.0,"08:00":20.0,
        "20:00":20.0,"24:00":16.0}}</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setProfile</dd>
      </dl>     
    <h3>Outputs</h3>
      <ol class="node-ports">
         <li>State
             <dl class="message-properties">
                 <dt>payload <span class="property-type">boolean</span></dt>
                 <dd>the state of the thermostat.</dd>
             </dl>
         </li>
         <li>Current Temperature
             <dl class="message-properties">
                 <dt>payload <span class="property-type">number</span></dt>
                 <dd>the current temperature.</dd>
             </dl>
         </li>
         <li>Target Temperature
             <dl class="message-properties">
                 <dt>payload <span class="property-type">number</span></dt>
                 <dd>the actual target temperature.</dd>
             </dl>
         </li>
      </ol>
     
    <h3>Details</h3>
    <p>The target temperature is defined by a profile that 
    provides the value depending on the current time <code>00:00-24:00</code>.
    The profile consists of several points whose connections build a sequence of lines.
    The switching moment can be optimized by defining a gradient line like a <code>ramp</code>.</p>
</script>

<script type="text/javascript">
    RED.nodes.registerType('ramp-thermostat',{
        category: 'smart home',
        color: '#E9967A',
        defaults: {
            name: {value:""},
            profile: {value:"",type:"profile"},
            hysteresisplus: {value:0, validate:RED.validators.number()},
            hysteresisminus: {value:0, validate:RED.validators.number()}
        },
        inputs:1,
        outputs:3,
        outputLabels: ["state","current temperature","target temperature"],
        icon: "trigger.png",
        label: function() {
            return this.name||"ramp-thermostat";
        },
        paletteLabel: 'thermostat'
    });
</script>

<script type="text/x-red" data-template-name="profile">
  <div class="form-row">
    <label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
    <input type="text" id="node-config-input-name">
  </div>
  
  <div>
    <label style="float:left; margin-bottom:10px"><i class="fa fa-dot-circle-o"></i> Points:</label>
    <label style="float:left;margin-left:45px;"> Time (hh:mm)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Temp (°)</label>
  </div>
  <div class="form-row">
    <label for="node-config-input-time1"><i class="fa fa-dot-circle-o"></i> #1</label>
    <input class="input-append-left" type="time" id="node-config-input-time1" style="width:80px">
    <input type="number" id="node-config-input-temp1" style="margin-left:45px; width:80px">
  </div>
  <div class="form-row">
    <label for="node-config-input-time2"><i class="fa fa-dot-circle-o"></i> #2</label>
    <input class="input-append-left" type="time" id="node-config-input-time2" style="width:80px">
    <input type="number" id="node-config-input-temp2" style="margin-left:45px; width:80px">
  </div>
  <div class="form-row">
    <label for="node-config-input-time3"><i class="fa fa-dot-circle-o"></i> #3</label>
    <input class="input-append-left" type="time" id="node-config-input-time3" style="width:80px">
    <input type="number" id="node-config-input-temp3" style="margin-left:45px; width:80px">
  </div>
  <div class="form-row">
    <label for="node-config-input-time4"><i class="fa fa-dot-circle-o"></i> #4</label>
    <input class="input-append-left" type="time" id="node-config-input-time4" style="width:80px">
    <input type="number" id="node-config-input-temp4" style="margin-left:45px; width:80px">
  </div>
  <div class="form-row">
    <label for="node-config-input-time5"><i class="fa fa-dot-circle-o"></i> #5</label>
    <input class="input-append-left" type="time" id="node-config-input-time5" style="width:80px">
    <input type="number" id="node-config-input-temp5" style="margin-left:45px; width:80px">
  </div>
  <div class="form-row">
    <label for="node-config-input-time6"><i class="fa fa-dot-circle-o"></i> #6</label>
    <input class="input-append-left" type="time" id="node-config-input-time6" style="width:80px">
    <input type="number" id="node-config-input-temp6" style="margin-left:45px; width:80px">
  </div>
  <div class="form-row">
    <label for="node-config-input-time7"><i class="fa fa-dot-circle-o"></i> #7</label>
    <input class="input-append-left" type="time" id="node-config-input-time7" style="width:80px">
    <input type="number" id="node-config-input-temp7" style="margin-left:45px; width:80px">
  </div>
  <div class="form-row">
    <label for="node-config-input-time8"><i class="fa fa-dot-circle-o"></i> #8</label>
    <input class="input-append-left" type="time" id="node-config-input-time8" style="width:80px">
    <input type="number" id="node-config-input-temp8" style="margin-left:45px; width:80px">
  </div>
  <div class="form-row">
    <label for="node-config-input-time9"><i class="fa fa-dot-circle-o"></i> #9</label>
    <input class="input-append-left" type="time" id="node-config-input-time9" style="width:80px">
    <input type="number" id="node-config-input-temp9" style="margin-left:45px; width:80px">
  </div>
  <div class="form-row">
    <label for="node-config-input-time10"><i class="fa fa-dot-circle-o"></i> #10</label>
    <input class="input-append-left" type="time" id="node-config-input-time10" style="width:80px">
    <input type="number" id="node-config-input-temp10" style="margin-left:45px; width:80px">
  </div>
  <div class="form-tips"><span>A Profile has at least 2 Points and should typically start at 00:00 and end at 24:00.</span>
  </div>
</script>

<script type="text/javascript">
    var time_re = /(^$)|(^(?:[01]\d|2[0-4]):[0-5]\d$)/;
    var temp_re = /^[+-]?\d*\.?\d+$|^$/;
    RED.nodes.registerType('profile',{
        category: 'config',
        defaults: {
            name: {value:'',required:true},
            time1: {value:'', validate:RED.validators.regex(time_re)},
            temp1: {value:'', validate:RED.validators.regex(temp_re)},
            time2: {value:'', validate:RED.validators.regex(time_re)},
            temp2: {value:'', validate:RED.validators.regex(temp_re)},
            time3: {value:'', validate:RED.validators.regex(time_re)},
            temp3: {value:'', validate:RED.validators.regex(temp_re)},
            time4: {value:'', validate:RED.validators.regex(time_re)},
            temp4: {value:'', validate:RED.validators.regex(temp_re)},
            time5: {value:'', validate:RED.validators.regex(time_re)},
            temp5: {value:'', validate:RED.validators.regex(temp_re)},
            time6: {value:'', validate:RED.validators.regex(time_re)},
            temp6: {value:'', validate:RED.validators.regex(temp_re)},
            time7: {value:'', validate:RED.validators.regex(time_re)},
            temp7: {value:'', validate:RED.validators.regex(temp_re)},<commit_msg>Wider fields + decimals allowed<commit_after><script type="text/x-red" data-template-name="ramp-thermostat">
    <div class="form-row">
        <label for="node-input-profile"><i class="fa fa-line-chart"></i> Profile</label>
        <input type="text" id="node-input-profile">
    </div>
    <div class="form-row">
        <label for="node-input-hysteresisplus"><i class="fa fa-arrows-v"></i> Hysteresis [+]</label>
        <input type="text" id="node-input-hysteresisplus" style="width:50px">
    </div>
    <div class="form-row">
        <label for="node-input-hysteresisminus"><i class="fa fa-arrows-v"></i> Hysteresis [-]</label>
        <input type="text" id="node-input-hysteresisminus" style="width:50px">
    </div>
    <div class="form-row">
        <label for="node-input-name"><i class="fa fa-tag"></i> Name</label>
        <input type="text" id="node-input-name" placeholder="Name">
    </div>
    <div class="form-tips"><span>The Hysteresis is used to prevent osciliation. The [+] value is added to the target and the [-] (absolute) value is subtracted from the target. Within this neutral zone no action accurs.</span>
    </div>
</script>

<script type="text/x-red" data-help-name="ramp-thermostat">
    <p>A node that emulates a thermostat.</p>
    <p>The ramp-thermostat controls an actuator depending on the current input temperature and the target temperature.</p>
        
    <h3>Inputs</h3>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">number</span>
        </dt>
        <dd> current temperature</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setCurrent (or undefined)</dd>
      </dl>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">number</span>
        </dt>
        <dd> target temperature</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setTarget</dd>
      </dl>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">number</span>
        </dt>
        <dd> hysteresis [+]</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setHysteresisPlus</dd>
      </dl>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">number</span>
        </dt>
        <dd> hysteresis [-]</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setHysteresisMinus</dd>
      </dl>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">string</span>
        </dt>
        <dd> profile name</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setProfile</dd>
      </dl>
      <dl class="message-properties">
        <dt>payload
            <span class="property-type">object</span>
        </dt>
        <dd> JSON e.g. {"name":"myGreatProfile","points":{"00:00":16.0,"08:00":20.0,
        "20:00":20.0,"24:00":16.0}}</dd>
        <dt class="optional">topic <span class="property-type">string</span></dt>
        <dd> setProfile</dd>
      </dl>     
    <h3>Outputs</h3>
      <ol class="node-ports">
         <li>State
             <dl class="message-properties">
                 <dt>payload <span class="property-type">boolean</span></dt>
                 <dd>the state of the thermostat.</dd>
             </dl>
         </li>
         <li>Current Temperature
             <dl class="message-properties">
                 <dt>payload <span class="property-type">number</span></dt>
                 <dd>the current temperature.</dd>
             </dl>
         </li>
         <li>Target Temperature
             <dl class="message-properties">
                 <dt>payload <span class="property-type">number</span></dt>
                 <dd>the actual target temperature.</dd>
             </dl>
         </li>
      </ol>
     
    <h3>Details</h3>
    <p>The target temperature is defined by a profile that 
    provides the value depending on the current time <code>00:00-24:00</code>.
    The profile consists of several points whose connections build a sequence of lines.
    The switching moment can be optimized by defining a gradient line like a <code>ramp</code>.</p>
</script>

<script type="text/javascript">
    RED.nodes.registerType('ramp-thermostat',{
        category: 'smart home',
        color: '#E9967A',
        defaults: {
            name: {value:""},
            profile: {value:"",type:"profile"},
            hysteresisplus: {value:0, validate:RED.validators.number()},
            hysteresisminus: {value:0, validate:RED.validators.number()}
        },
        inputs:1,
        outputs:3,
        outputLabels: ["state","current temperature","target temperature"],
        icon: "trigger.png",
        label: function() {
            return this.name||"ramp-thermostat";
        },
        paletteLabel: 'thermostat'
    });
</script>

<script type="text/x-red" data-template-name="profile">
  <div class="form-row">
    <label for="node-config-input-name"><i class="fa fa-tag"></i> Name</label>
    <input type="text" id="node-config-input-name">
  </div>
  
  <div>
    <label style="float:left; margin-bottom:10px"><i class="fa fa-dot-circle-o"></i> Points:</label>
    <label style="float:left;margin-left:45px;"> Time (hh:mm)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Temp (°)</label>
  </div>
  <div class="form-row">
    <label for="node-config-input-time1"><i class="fa fa-dot-circle-o"></i> #1</label>
    <input class="input-append-left" type="time" id="node-config-input-time1" style="width:100px">
    <input type="number" id="node-config-input-temp1" style="margin-left:45px; width:100px" step=".01">
  </div>
  <div class="form-row">
    <label for="node-config-input-time2"><i class="fa fa-dot-circle-o"></i> #2</label>
    <input class="input-append-left" type="time" id="node-config-input-time2" style="width:100px">
    <input type="number" id="node-config-input-temp2" style="margin-left:45px; width:100px" step=".01">
  </div>
  <div class="form-row">
    <label for="node-config-input-time3"><i class="fa fa-dot-circle-o"></i> #3</label>
    <input class="input-append-left" type="time" id="node-config-input-time3" style="width:100px">
    <input type="number" id="node-config-input-temp3" style="margin-left:45px; width:100px" step=".01">
  </div>
  <div class="form-row">
    <label for="node-config-input-time4"><i class="fa fa-dot-circle-o"></i> #4</label>
    <input class="input-append-left" type="time" id="node-config-input-time4" style="width:100px">
    <input type="number" id="node-config-input-temp4" style="margin-left:45px; width:100px" step=".01">
  </div>
  <div class="form-row">
    <label for="node-config-input-time5"><i class="fa fa-dot-circle-o"></i> #5</label>
    <input class="input-append-left" type="time" id="node-config-input-time5" style="width:100px">
    <input type="number" id="node-config-input-temp5" style="margin-left:45px; width:100px" step=".01">
  </div>
  <div class="form-row">
    <label for="node-config-input-time6"><i class="fa fa-dot-circle-o"></i> #6</label>
    <input class="input-append-left" type="time" id="node-config-input-time6" style="width:100px">
    <input type="number" id="node-config-input-temp6" style="margin-left:45px; width:100px" step=".01">
  </div>
  <div class="form-row">
    <label for="node-config-input-time7"><i class="fa fa-dot-circle-o"></i> #7</label>
    <input class="input-append-left" type="time" id="node-config-input-time7" style="width:100px">
    <input type="number" id="node-config-input-temp7" style="margin-left:45px; width:100px" step=".01">
  </div>
  <div class="form-row">
    <label for="node-config-input-time8"><i class="fa fa-dot-circle-o"></i> #8</label>
    <input class="input-append-left" type="time" id="node-config-input-time8" style="width:100px">
    <input type="number" id="node-config-input-temp8" style="margin-left:45px; width:100px" step=".01">
  </div>
  <div class="form-row">
    <label for="node-config-input-time9"><i class="fa fa-dot-circle-o"></i> #9</label>
    <input class="input-append-left" type="time" id="node-config-input-time9" style="width:100px">
    <input type="number" id="node-config-input-temp9" style="margin-left:45px; width:100px" step=".01">
  </div>
  <div class="form-row">
    <label for="node-config-input-time10"><i class="fa fa-dot-circle-o"></i> #10</label>
    <input class="input-append-left" type="time" id="node-config-input-time10" style="width:100px">
    <input type="number" id="node-config-input-temp10" style="margin-left:45px; width:100px" step=".01">
  </div>
  <div class="form-tips"><span>A Profile has at least 2 Points and should typically start at 00:00 and end at 24:00.</span>
  </div>
</script>

<script type="text/javascript">
    var time_re = /(^$)|(^(?:[01]\d|2[0-4]):[0-5]\d$)/;
    var temp_re = /^[+-]?\d*\.?\d+$|^$/;
    RED.nodes.registerType('profile',{
        category: 'config',
        defaults: {
            name: {value:'',required:true},
            time1: {value:'', validate:RED.validators.regex(time_re)},
            temp1: {value:'', validate:RED.validators.regex(temp_re)},
            time2: {value:'', validate:RED.validators.regex(time_re)},
            temp2: {value:'', validate:RED.validators.regex(temp_re)},
            time3: {value:'', validate:RED.validators.regex(time_re)},
            temp3: {value:'', validate:RED.validators.regex(temp_re)},
            time4: {value:'', validate:RED.validators.regex(time_re)},
            temp4: {value:'', validate:RED.validators.regex(temp_re)},
            time5: {value:'', validate:RED.validators.regex(time_re)},
            temp5: {value:'', validate:RED.validators.regex(temp_re)},
            time6: {value:'', validate:RED.validators.regex(time_re)},
            temp6: {value:'', validate:RED.validators.regex(temp_re)},
            time7: {value:'', validate:RED.validators.regex(time_re)},
            temp7: {value:'', validate:RED.validators.regex(temp_re)},
{'fraction_non_alphanumeric': 0.19503160806005532, 'fraction_numerical': 0.020940339786645595, 'mean_word_length': 3.1536410256410257, 'pattern_counts': {'":': 12, '<': 547, '<?xml version=': 0, '>': 547, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1064689', 'n_tokens_mistral': 6910, 'n_tokens_neox': 6676, 'n_words': 1244}