2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 18:59:33 +00:00

small optimization

git-svn-id: https://svn.fhem.de/fhem/trunk@3815 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
justme-1968 2013-08-28 12:29:20 +00:00
parent 056fbad680
commit d048d8de7e

View File

@ -360,6 +360,12 @@ readingsGroup_Notify($$)
$value = $s;
}
my $value_format = AttrVal( $name, "valueFormat", "" );
if( $value_format =~ m/^{.*}$/ ) {
my $vf = eval $value_format;
$value_format = $vf if( $vf );
}
foreach my $device (@{$devices}) {
my $h = $defs{@{$device}[0]};
next if( !$h );
@ -367,11 +373,6 @@ readingsGroup_Notify($$)
my $regex = @{$device}[1];
next if( defined($regex) && $reading !~ m/^$regex$/);
my $value_format = AttrVal( $name, "valueFormat", "" );
if( $value_format =~ m/^{.*}$/ ) {
my $vf = eval $value_format;
$value_format = $vf if( $vf );
}
if( $value_format ) {
my $value_format = $value_format;
if( ref($value_format) eq 'HASH' ) {