2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-02-07 16:59:18 +00:00

47_OBIS: Fixed 2 small bugs

git-svn-id: https://svn.fhem.de/fhem/trunk@12130 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
icinger 2016-09-08 02:42:25 +00:00
parent f224014b75
commit 5994f8acee

View File

@ -226,7 +226,7 @@ sub OBIS_Read($)
my $buf = DevIo_SimpleRead($hash);
my $b=$buf;
$b =~ s/(.)/sprintf("%X",ord($1))/eg;
if ($hash->{helper}{SpeedChange} eq "")
if (defined $hash->{helper}{SpeedChange} && $hash->{helper}{SpeedChange} eq "")
{
OBIS_Parse($hash,$buf) if ($hash->{helper}{EoM}!=1);
Log3 $hash,4, "parsing....\r\n";
@ -488,7 +488,11 @@ sub OBIS_Parse($$)
$data=$SML_specialities{"TIME"}[1]->($1)
}
my $chan=$code//$OBIS_channels{$channel} //$channel;
$chan=$hash->{helper}{Channels}{$channel} //$hash->{helper}{Channels}{$1} // $OBIS_channels{$1} //$channel;
if ($#+ > 0) {
$chan=$hash->{helper}{Channels}{$channel} // $hash->{helper}{Channels}{$1} // $OBIS_channels{$1} //$channel;
} else {
$chan=$hash->{helper}{Channels}{$channel} //$channel;
}
if (AttrVal($name,"ignoreUnknown","off") eq "off" || $chan ne $channel) {
readingsBulkUpdate($hash, $chan ,$data); }