2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-10 09:16:53 +00:00

10_ZWave.pm: do not delete a number in the beginning of the config Value (Forum #51865)

git-svn-id: https://svn.fhem.de/fhem/trunk@11218 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2016-04-10 10:41:49 +00:00
parent e49183ee91
commit c5b36b4693

View File

@ -2259,12 +2259,12 @@ ZWave_clockParse($$)
} }
sub sub
ZWave_cleanString($$) ZWave_cleanString($$$)
{ {
my ($c, $postfix) = @_; my ($c, $postfix, $isValue) = @_;
my $shortened = 0; my $shortened = 0;
$c =~ s/^[0-9.]+ //g; $c =~ s/^[0-9.]+ //g if(!$isValue);
$c =~ s/Don.t/Dont/g; # Bugfix $c =~ s/Don.t/Dont/g; # Bugfix
if($c =~ m/^(.+)\.(.+)$/ && $2 !~ m/^[ \d]+$/) { # delete second sentence if($c =~ m/^(.+)\.(.+)$/ && $2 !~ m/^[ \d]+$/) { # delete second sentence
$c = $1; $shortened++; $c = $1; $shortened++;
@ -2324,7 +2324,7 @@ ZWave_configParseModel($;$)
$h{index} = $1 if($line =~ m/index="([^"]*)"/i); # 1, 2, etc $h{index} = $1 if($line =~ m/index="([^"]*)"/i); # 1, 2, etc
$h{read_only} = $1 if($line =~ m/read_only="([^"]*)"/i); # true,false $h{read_only} = $1 if($line =~ m/read_only="([^"]*)"/i); # true,false
$h{write_only} = $1 if($line =~ m/write_only="([^"]*)"/i); # true,false $h{write_only} = $1 if($line =~ m/write_only="([^"]*)"/i); # true,false
my ($cmd,$shortened) = ZWave_cleanString($h{label}, $h{index}); my ($cmd,$shortened) = ZWave_cleanString($h{label}, $h{index}, 0);
$cmdName = "config$cmd"; $cmdName = "config$cmd";
$h{Help} = ""; $h{Help} = "";
$h{Help} .= "Full text for $cmdName is: $h{label}<br>" if($shortened); $h{Help} .= "Full text for $cmdName is: $h{label}<br>" if($shortened);
@ -2335,7 +2335,7 @@ ZWave_configParseModel($;$)
if($line =~ m/^\s*<Item/) { if($line =~ m/^\s*<Item/) {
my $label = $1 if($line =~ m/label="([^"]*)"/i); my $label = $1 if($line =~ m/label="([^"]*)"/i);
my $value = $1 if($line =~ m/value="([^"]*)"/i); my $value = $1 if($line =~ m/value="([^"]*)"/i);
my ($item, $shortened) = ZWave_cleanString($label, $value); my ($item, $shortened) = ZWave_cleanString($label, $value, 1);
$hash{$cmdName}{Item}{$item} = $value; $hash{$cmdName}{Item}{$item} = $value;
$hash{$cmdName}{type} = "list"; # Forum #42604 $hash{$cmdName}{type} = "list"; # Forum #42604
$hash{$cmdName}{Help} .= "Full text for $item is $label<br>" $hash{$cmdName}{Help} .= "Full text for $item is $label<br>"