mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-05-04 22:19:38 +00:00
98_CustomReadings.pm: fixed the bug when the script returned zero
git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@8204 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
37d6466ea9
commit
7d73d88960
@ -82,9 +82,9 @@ sub CustomReadings_read($)
|
|||||||
$isCombined = 0;
|
$isCombined = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
my $value = 0;
|
my $value;
|
||||||
if ($isCombined) {
|
if ($isCombined) {
|
||||||
$value = shift @combinedOutput;
|
$value = shift @combinedOutput;
|
||||||
|
|
||||||
if (!($value)) {
|
if (!($value)) {
|
||||||
$value = 0;
|
$value = 0;
|
||||||
@ -96,7 +96,7 @@ sub CustomReadings_read($)
|
|||||||
$value = eval($definition[1]);
|
$value = eval($definition[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($value) {
|
if(defined $value) {
|
||||||
$value =~ s/^\s+|\s+$//g;
|
$value =~ s/^\s+|\s+$//g;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user