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

Slider: "on/off" causes NaN -> converted it to 0

git-svn-id: https://svn.fhem.de/fhem/trunk@2821 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2013-02-27 09:55:55 +00:00
parent 4c44c864d1
commit 64f8d6a897
2 changed files with 3 additions and 0 deletions

View File

@ -1088,6 +1088,7 @@ FW_showRoom()
my $cv = ReadingsVal($d, $cmd, Value($d));
$cmd = "" if($cmd eq "state");
$cv =~ s/.*?(\d+).*/$1/; # get first number
$cv = 0 if($cv !~ m/\d/);
FW_pO "<td colspan='2'>".
"<div class='slider' id='slider.$d' ".
"min='$min' stp='$stp' max='$max' ".

View File

@ -60,6 +60,8 @@ FW_doUpdate()
}
if(doSet) {
var val = d[1].replace(/^.*?(\d+).*/g, "$1"); // get first number
if(!val.match(/\d+/))
val = 0;
Slider(el, val);
}
}