2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

10_ZWave.pm: fix help in detail, add ZME_WALLC-S data by Thargor (Forum #32918)

git-svn-id: https://svn.fhem.de/fhem/trunk@7754 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2015-01-28 11:42:32 +00:00
parent dd8f0ecae6
commit db0009fea0
3 changed files with 18 additions and 29 deletions

View File

@ -1098,7 +1098,7 @@ ZWave_helpFn($$)
return "" if(!$mc);
my $h = $mc->{config}{$cmd};
return "" if(!$h || !$h->{Help});
return "Help for $cmd:<br>".$h->{Help}."<br><br>";
return "Help for $cmd:<br>".$h->{Help};
}
sub
@ -1106,34 +1106,22 @@ ZWave_fhemwebFn($$$$)
{
my ($FW_wname, $d, $room, $pageHash) = @_; # pageHash is set for summaryFn.
return "<div id=\"Help_$d\" class=\"help\"></div>".<<JSEND
<script type="text/javascript">
var oldHelp={};
var helpDiv=document.querySelector("#Help_$d");
setTimeout(function() { // Wait for it to appear, thn move it
var w=document.querySelector("div.makeTable.wide");
w.insertBefore(helpDiv,w.firstChild);
}, 200);
function helpSet(val) { helpDiv.innerHTML=val; }
function
helpCheck(name)
{
var sel = document.querySelector("select."+name);
if(!sel)
return;
var newVal = sel.options[sel.selectedIndex].value;
if(oldHelp[name] && oldHelp[name] != newVal) {
FW_queryValue('{ZWave_helpFn("$d","'+newVal+'")}', 'helpSet("%")', '');
}
oldHelp[name] = newVal;
}
setInterval(function() {
helpCheck("set");
helpCheck("get");
}, 300);
return
'<div id="ZWHelp" class="makeTable help"></div>'.
'<script type="text/javascript">'.
"var d='$d';" . <<'JSEND'
$(document).ready(function() {
$("div#ZWHelp").insertBefore("div.makeTable.wide:first"); // Move
$("select.set,select.get").each(function(){
$(this).get(0).setValueFn = function(val) {
$("div#ZWHelp").html(val);
}
$(this).change(function(){
FW_queryValue('{ZWave_helpFn("'+d+'","'+$(this).val()+'")}',
$(this).get(0));
});
});
});
</script>
JSEND
}

View File

@ -524,6 +524,7 @@
<Product type="0100" id="0004" name="ZME_WCD2 Double Paddle Wall Controller" config="zwave.me/ZME_WCD2.xml"/>
<Product type="0201" id="0001" name="iTemp" config="zwave.me/iTemp.xml" />
<Product type="0200" id="0001" name="iTemp" config="zwave.me/iTemp.xml" />
<Product type="0100" id="0101" name="ZME_WALLC-S 4 Button Wall Controller" config="zwave.me/ZME_WALLC-S.xml"/>
</Manufacturer>
<Manufacturer id="004f" name="Z-Wave Technologia">
</Manufacturer>