mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-01 00:19:00 +00:00
98_GAEBUS.pm: perl warnings entfernt wenn wert von Attribut leer ist
git-svn-id: https://svn.fhem.de/fhem/trunk@9260 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ebb0b6a8fd
commit
9e7840d6b8
@ -13,6 +13,7 @@
|
|||||||
# 13.09.2015 : A.Goebel : increase timeout for reads from ebusd from 1.8 to 5.0
|
# 13.09.2015 : A.Goebel : increase timeout for reads from ebusd from 1.8 to 5.0
|
||||||
# 14.09.2015 : A.Goebel : use utf-8 coding to display values from ".csv" files
|
# 14.09.2015 : A.Goebel : use utf-8 coding to display values from ".csv" files
|
||||||
# 14.09.2015 : A.Goebel : add optional parameter [FIELD[.N]] of read from ebusd to reading name
|
# 14.09.2015 : A.Goebel : add optional parameter [FIELD[.N]] of read from ebusd to reading name
|
||||||
|
# 15.09.2015 : A.Goebel : get rid of perl warnings when attribute value is empty
|
||||||
|
|
||||||
package main;
|
package main;
|
||||||
|
|
||||||
@ -325,9 +326,12 @@ GAEBUS_Get($@)
|
|||||||
my ($readingnameX, $cmdaddon) = split (" ", $attr{$name}{$oneattr}, 2);
|
my ($readingnameX, $cmdaddon) = split (" ", $attr{$name}{$oneattr}, 2);
|
||||||
$cmdaddon = "" unless (defined ($cmdaddon));
|
$cmdaddon = "" unless (defined ($cmdaddon));
|
||||||
|
|
||||||
|
next unless defined ($readingnameX);
|
||||||
|
next if ($readingnameX =~ /^\s*$/);
|
||||||
|
next if ($readingnameX eq "1");
|
||||||
|
|
||||||
my ($readingname, $doCntNo) = split (":", $readingnameX, 2); # split name from cycle number
|
my ($readingname, $doCntNo) = split (":", $readingnameX, 2); # split name from cycle number
|
||||||
$doCntNo = 1 unless (defined ($doCntNo));
|
$doCntNo = 1 unless (defined ($doCntNo));
|
||||||
Log3 ($name, 2, "$name <$readingnameX>");
|
|
||||||
|
|
||||||
#my $readingname = $attr{$name}{$oneattr};
|
#my $readingname = $attr{$name}{$oneattr};
|
||||||
my $readingcmdname = $oneattr;
|
my $readingcmdname = $oneattr;
|
||||||
@ -337,13 +341,10 @@ Log3 ($name, 2, "$name <$readingnameX>");
|
|||||||
# only for "r" commands
|
# only for "r" commands
|
||||||
if ($oneattr =~ /^r.*$delimiter.*$delimiter.*$delimiter.*$/)
|
if ($oneattr =~ /^r.*$delimiter.*$delimiter.*$delimiter.*$/)
|
||||||
{
|
{
|
||||||
unless ($readingname =~ /^\s*$/ or $readingname eq "1")
|
$readings{$readingname} = $readingcmdname;
|
||||||
{
|
$readingsCmdaddon{$readingname} = $cmdaddon;
|
||||||
$readings{$readingname} = $readingcmdname;
|
|
||||||
$readingsCmdaddon{$readingname} = $cmdaddon;
|
|
||||||
|
|
||||||
#Log3 ($name, 2, "$name GetParams $readingname");
|
#Log3 ($name, 2, "$name GetParams $readingname");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#Log3 ($name, 4, "$name Get attr name $readingname");
|
#Log3 ($name, 4, "$name Get attr name $readingname");
|
||||||
@ -869,14 +870,15 @@ GAEBUS_GetUpdates($)
|
|||||||
my ($readingnameX, $cmdaddon) = split (" ", $attr{$name}{$oneattr}, 2);
|
my ($readingnameX, $cmdaddon) = split (" ", $attr{$name}{$oneattr}, 2);
|
||||||
$cmdaddon = "" unless (defined ($cmdaddon));
|
$cmdaddon = "" unless (defined ($cmdaddon));
|
||||||
|
|
||||||
|
next unless defined ($readingnameX);
|
||||||
|
next if ($readingnameX =~ /^\s*$/);
|
||||||
|
next if ($readingnameX eq "1");
|
||||||
|
|
||||||
my ($readingname, $doCntNo) = split (":", $readingnameX, 2); # split name from cycle number
|
my ($readingname, $doCntNo) = split (":", $readingnameX, 2); # split name from cycle number
|
||||||
$doCntNo = 1 unless (defined ($doCntNo));
|
$doCntNo = 1 unless (defined ($doCntNo));
|
||||||
|
|
||||||
Log3 ($name, 5, "$name GetUpdates: $readingname:$doCntNo");
|
Log3 ($name, 5, "$name GetUpdates: $readingname:$doCntNo");
|
||||||
|
|
||||||
next if ($readingname =~ /^\s*$/);
|
|
||||||
next if ($readingname eq "1");
|
|
||||||
|
|
||||||
#Log3 ($name, 2, "$name check modulo ".$hash->{UpdateCnt}." mod $doCntNo -> ".($hash->{UpdateCnt} % $doCntNo));
|
#Log3 ($name, 2, "$name check modulo ".$hash->{UpdateCnt}." mod $doCntNo -> ".($hash->{UpdateCnt} % $doCntNo));
|
||||||
if (($hash->{UpdateCnt} % $doCntNo) == 0)
|
if (($hash->{UpdateCnt} % $doCntNo) == 0)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user