Je cherche à mettre à jour ce widget mais je ne maitrise pas assez le code.
Je cherche une ame charitable qui pourrait jeter un oeil sur le code et me dire ce qu'il faut changer pour avoir une réactualisation régulière des valeurs, sachant que les info remontent toutes les 5s.
Code : Tout sélectionner
<div style="width:300px;min-height : 100px;" class="cmd #history# tooltips cmd-widget conso#id#" data-type="info" data-subtype="numeric" data-cmd_id="#id#" title="#collectDate#">
<div class="gauge-element" id="pressureGauge" style="height: 100px; max-width: 300px; margin: 0 auto"></div>
<script src='/plugins/widget/core/template/dashboard/cmd.info.numeric.PhPiscine/dx.all.js'></script>
<script>
$(function(){
var pressureGauge = $("#pressureGauge").dxLinearGauge({
title: {
text: "Pression filtration",
font: {
size: 26,
color: '#61B872'
}
},
geometry: { orientation: "horizontal" },
scale: {
label: {
format: {
type: "fixedPoint",
precision: 1
},
indentFromTick: 15
},
startValue: 0, endValue: 250,
tick: {
color: 'white',
length: 15
},
customTicks: [50, 100,150,200]
},
rangeContainer: {
offset: 0,
width: 15,
ranges: [
{ startValue: 0, endValue: 50, color: "red" },
{ startValue: 50, endValue: 100, color: "orange" },
{ startValue: 100, endValue: 150, color: "green" },
{ startValue: 150, endValue: 200, color: "orange" },
{ startValue: 200, endValue: 250, color: "red" }
]
},
valueIndicator: {
type: "textcloud",
color: "#61B872",
text: {
format: {
precision: 1
}
}
},
value : #state#
}).dxLinearGauge("instance");
});
jeedom.cmd.update['#id#']({display_value:'#state#',valueDate:'#valueDate#',collectDate:'#collectDate#',alertLevel:'#alertLevel#'});
</script>
</div>