small bugfixes

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@961 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
hotmaz 2011-07-29 20:51:25 +00:00
parent 8cdc8d0392
commit 4c87be51e8
2 changed files with 4 additions and 4 deletions

View File

@ -72,7 +72,7 @@ TUL_Define($$)
my $name = $a[0];
my $dev = $a[2];
my $devaddr = tul_str2hex($a[3],0);
my $devaddr = tul_str2hex($a[3]);
my $linedef = substr(tul_str2hex($a[4]),0,2) if(@a > 4);
if($dev eq "none") {
@ -585,7 +585,7 @@ TUL_Attr(@)
sub tul_hex2addr {
my $str = lc($_[0]);
if ($str =~ /([0-9a-f])([0-9a-f])([0-9a-f]{2})/) {
return (hex($1) << 11) | (hex($2) << 8) | hex($3);
return (hex($1) << 12) | (hex($2) << 8) | hex($3);
}
else
{

View File

@ -53,9 +53,9 @@ EIB_Define($$)
return $u if(int(@a) < 3);
return "Define $a[0]: wrong group name format: specify as 0-15/0-15/0-255 or as hex"
if( ($a[2] !~ m/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,3}$/i) && ($a[2] !~ m/^[0-9]{4}$/i));
if( ($a[2] !~ m/^[0-9]{1,2}\/[0-9]{1,2}\/[0-9]{1,3}$/i) && (lc($a[2]) !~ m/^[0-9a-f]{4}$/i));
my $groupname = eib_name2hex($a[2]);
my $groupname = eib_name2hex(lc($a[2]));
$hash->{GROUP} = lc($groupname);