Created
August 27, 2022 11:28
-
-
Save tcalmant/21a9f59c335f65ec026883ea847efe15 to your computer and use it in GitHub Desktop.
Jeedom custom template for an ESP Easy based 6-order pilot wire heating. To be placed in `jeedom/data/customTemplates/dashboard`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div style="width:120px;min-height:35px;margin-top:10px" class="cmd #history# tooltips cmd-widget" data-type="info" | |
data-subtype="numeric" data-cmd_id="#id#" title="Valeur du #valueDate#, collectée le #collectDate#"> | |
<center> | |
<span style="font-size: 1.2em;" class="label label-info" id="iconCmd#id#">N/A</span> | |
</center> | |
<script> | |
function updateText(cmdId, state) { | |
let iconId = "#iconCmd" + cmdId; | |
if (state < 11) { | |
$(iconId).text("Arrêt"); | |
} else if (state < 21) { | |
$(iconId).text("Hors Gel"); | |
} else if (state < 31) { | |
$(iconId).text("Éco"); | |
} else if (state < 41) { | |
$(iconId).text("Confort-2°C"); | |
} else if (state < 51) { | |
$(iconId).text("Confort-1°C"); | |
} else { | |
$(iconId).text("Confort"); | |
} | |
}; | |
jeedom.cmd.update["#id#"] = function (_options) { | |
updateText("#id#", _options.display_value); | |
} | |
if (is_numeric('#state#')) { | |
jeedom.cmd.update['#id#']({ display_value: '#state#', valueDate: '#valueDate#', collectDate: '#collectDate#' }) | |
} else { | |
$("#iconCmd#id#").html('<center><span class="label label-danger">#state#</span></center>'); | |
} | |
</script> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment