mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-03-10 09:16:53 +00:00
fhem.pl: allow attr ? for featurelevel > 5.9 (Forum #107550)
git-svn-id: https://svn.fhem.de/fhem/trunk@21043 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ecf3022abd
commit
c4b57b770b
@ -334,7 +334,7 @@ my @globalAttrList = qw(
|
|||||||
dnsServer
|
dnsServer
|
||||||
dupTimeout
|
dupTimeout
|
||||||
exclude_from_update
|
exclude_from_update
|
||||||
featurelevel:5.9,5.8,5.7,5.6,5.5,99.99
|
featurelevel:6.0,5.9,5.8,5.7,5.6,5.5,99.99
|
||||||
genericDisplayType:switch,outlet,light,blind,speaker,thermostat
|
genericDisplayType:switch,outlet,light,blind,speaker,thermostat
|
||||||
holiday2we
|
holiday2we
|
||||||
httpcompress:0,1
|
httpcompress:0,1
|
||||||
@ -2874,7 +2874,7 @@ CommandAttr($$)
|
|||||||
if(@a && @a < 2);
|
if(@a && @a < 2);
|
||||||
my $a1 = $a[1];
|
my $a1 = $a[1];
|
||||||
return "bad attribute name $a1 (contains not A-Za-z/\\d_\\.- or is too long)"
|
return "bad attribute name $a1 (contains not A-Za-z/\\d_\\.- or is too long)"
|
||||||
if($featurelevel > 5.9 && !goodReadingName($a1));
|
if($featurelevel > 5.9 && !goodReadingName($a1) && $a1 ne "?");
|
||||||
|
|
||||||
my @rets;
|
my @rets;
|
||||||
foreach my $sdev (devspec2array($a[0], $a1 && $a1 eq "?" ? undef : $cl)) {
|
foreach my $sdev (devspec2array($a[0], $a1 && $a1 eq "?" ? undef : $cl)) {
|
||||||
@ -5779,7 +5779,6 @@ goodReadingName($)
|
|||||||
{
|
{
|
||||||
my ($name) = @_;
|
my ($name) = @_;
|
||||||
return undef if(!$name);
|
return undef if(!$name);
|
||||||
return undef if($featurelevel > 5.9 && length($name) > 64);
|
|
||||||
return ($name =~ m/^[a-z0-9._\-\/]+$/i || $name =~ m/^\./);
|
return ($name =~ m/^[a-z0-9._\-\/]+$/i || $name =~ m/^\./);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -5790,7 +5789,6 @@ makeReadingName($) # Convert non-valid characters to _
|
|||||||
$name = "UNDEFINED" if(!defined($name));
|
$name = "UNDEFINED" if(!defined($name));
|
||||||
return $name if($name =~ m/^\./);
|
return $name if($name =~ m/^\./);
|
||||||
$name =~ s/[^a-z0-9._\-\/]/_/gi;
|
$name =~ s/[^a-z0-9._\-\/]/_/gi;
|
||||||
$name = substr($name, 0, 64) if($featurelevel > 5.9 && length($name) > 64);
|
|
||||||
return $name;
|
return $name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user