2014-06-08 15:53:54 +00:00
|
|
|
|
2017-03-02 13:03:29 +00:00
|
|
|
FW_version["fhemweb_readingsHistory.js"] = "$Id$";
|
2017-01-16 13:14:31 +00:00
|
|
|
|
2014-06-08 15:53:54 +00:00
|
|
|
function
|
|
|
|
FW_readingsHistoryUpdateLine(d){
|
|
|
|
|
|
|
|
var dd = d[0].split("-", 3);
|
|
|
|
|
|
|
|
if(dd.length != 2)
|
|
|
|
return;
|
|
|
|
|
|
|
|
var clear = 0;
|
|
|
|
if( dd[1] == "clear" )
|
|
|
|
clear = 1;
|
|
|
|
else if( dd[1] != "history" )
|
|
|
|
return;
|
|
|
|
|
|
|
|
var name = dd[0] + "-history";
|
|
|
|
|
|
|
|
el = document.getElementById(name);
|
|
|
|
|
|
|
|
if( el ) {
|
|
|
|
var rows = el.getAttribute("rows");
|
|
|
|
var lines = el.innerHTML.split( "<br>", rows );
|
|
|
|
|
|
|
|
el.innerHTML = d[1] + "<br>";
|
|
|
|
for( i = 0; i <= rows-2; ++i )
|
|
|
|
{
|
|
|
|
if( !clear )
|
|
|
|
el.innerHTML += lines[i];
|
|
|
|
|
|
|
|
el.innerHTML += "<br>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2017-10-03 16:40:58 +00:00
|
|
|
function FW_readingsHistoryCreate(elName, devName, vArr, currVal, set, params, cmd)
|
|
|
|
{
|
|
|
|
}
|
2014-06-08 15:53:54 +00:00
|
|
|
|
|
|
|
FW_widgets['readingsHistory'] = {
|
2017-10-03 16:40:58 +00:00
|
|
|
createFn:FW_readingsHistoryCreate,
|
2014-06-08 15:53:54 +00:00
|
|
|
updateLine:FW_readingsHistoryUpdateLine
|
|
|
|
};
|
2017-10-03 16:40:58 +00:00
|
|
|
|
|
|
|
|
2017-10-03 17:53:27 +00:00
|
|
|
/*
|
2017-10-03 16:40:58 +00:00
|
|
|
=pod
|
|
|
|
=cut
|
2017-10-03 17:53:27 +00:00
|
|
|
*/
|