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:
parent
4c44c864d1
commit
64f8d6a897
@ -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' ".
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user