mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-20 07:16:03 +00:00
98_GAEBUS.pm : ignore error messages from ebusd when filling readings
git-svn-id: https://svn.fhem.de/fhem/trunk@21010 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
d0722b8004
commit
9da9cb82e3
@ -52,6 +52,7 @@
|
||||
# 05.01.2020 : A.Goebel : fix supress sprintf warnings in valueFormat evaluation
|
||||
# 09.01.2020 : A.Goebel : fix to skip readings named "dummy"
|
||||
# 09.01.2020 : A.Goebel : fix handling for valueFormat, give exact number of parameters to sprintf and shift all of them
|
||||
# 16.01.2020 : A.Goebel : add ignore error messages returned by ebusd
|
||||
|
||||
package main;
|
||||
|
||||
@ -1077,26 +1078,34 @@ GAEBUS_doEbusCmd($$$$$$$)
|
||||
|
||||
if ($inBlockingCall)
|
||||
{
|
||||
$actMessage = "";
|
||||
if ($actMessage =~ /^ERR: /) {
|
||||
# readings will be updated in main fhem process
|
||||
# really need to return nothing!
|
||||
return "lasterror|$actMessage";
|
||||
|
||||
foreach my $r (@targetreading)
|
||||
{
|
||||
if ($r eq "dummy") {
|
||||
shift @values;
|
||||
} else {
|
||||
# shift is done in GAEBUS_valueFormat
|
||||
my $v = GAEBUS_valueFormat ($hash, $r, \@values);
|
||||
$actMessage .= $r."|".$v."|";
|
||||
} else {
|
||||
$actMessage = "";
|
||||
|
||||
foreach my $r (@targetreading)
|
||||
{
|
||||
if ($r eq "dummy") {
|
||||
shift @values;
|
||||
} else {
|
||||
# shift is done in GAEBUS_valueFormat
|
||||
my $v = GAEBUS_valueFormat ($hash, $r, \@values);
|
||||
$actMessage .= $r."|".$v."|";
|
||||
}
|
||||
}
|
||||
|
||||
$actMessage =~ s/\|$//;
|
||||
|
||||
# readings will be updated in main fhem process
|
||||
Log3 ($name, 3, "$name returns actMessage as $actMessage");
|
||||
return $actMessage;
|
||||
}
|
||||
|
||||
$actMessage =~ s/\|$//;
|
||||
|
||||
# readings will be updated in main fhem process
|
||||
return $actMessage;
|
||||
}
|
||||
|
||||
if ($action eq "r")
|
||||
if ($action eq "r" and not $actMessage =~ /^ERR: /)
|
||||
{
|
||||
readingsBeginUpdate ($hash);
|
||||
|
||||
@ -1115,21 +1124,6 @@ GAEBUS_doEbusCmd($$$$$$$)
|
||||
readingsEndUpdate($hash, 1);
|
||||
}
|
||||
|
||||
|
||||
#if ($inBlockingCall) {
|
||||
# $actMessage = $readingname."|".$actMessage;
|
||||
#}
|
||||
#else {
|
||||
#
|
||||
# if ($action eq "r") {
|
||||
# if (defined ($readingname)) {
|
||||
# # BlockingCall changes
|
||||
# readingsSingleUpdate ($hash, $readingname, "$actMessage", 1);
|
||||
# }
|
||||
# }
|
||||
#}
|
||||
|
||||
|
||||
return $actMessage;
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user