mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-07 19:04:20 +00:00
74_AMAD: AMADCommBridge communication problem with automagic 1.29
git-svn-id: https://svn.fhem.de/fhem/trunk@9782 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
2a8f93e626
commit
30c35505cc
@ -1,5 +1,6 @@
|
||||
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
|
||||
# Do not insert empty lines here, update check depends on it.
|
||||
- bugfix: 74_AMAD: AMADCommBridge communication problem with automagic 1.29
|
||||
- feature: fhem_codemirror: Added DOIF autocomplete-keywords. Added feature
|
||||
to autocomplete on any keypress.
|
||||
- change: ATTENTION: Removed deprecated module 75_MSG.pm. Users will need to
|
||||
|
@ -35,7 +35,7 @@ use Time::HiRes qw(gettimeofday);
|
||||
use HttpUtils;
|
||||
use TcpServerUtils;
|
||||
|
||||
my $version = "0.8.1";
|
||||
my $version = "0.8.2";
|
||||
|
||||
|
||||
|
||||
@ -894,13 +894,13 @@ sub AMAD_CommBridge_Read($) {
|
||||
###
|
||||
|
||||
my @data = split( '\R\R', $buf );
|
||||
my $chash = undef;
|
||||
|
||||
if ( $data[0] =~ /FHEMCMD: setreading\b/ ) {
|
||||
my $tv = $data[1];
|
||||
|
||||
@data = split( '\R', $data[0] );
|
||||
$data[2] =~ s/FHEMDEVICE: //;
|
||||
my $chash = $defs{$data[2]};
|
||||
|
||||
### Begin Response Processing
|
||||
|
||||
my @valuestring = split( '@@@@', $tv );
|
||||
@ -913,15 +913,38 @@ sub AMAD_CommBridge_Read($) {
|
||||
|
||||
my $t;
|
||||
my $v;
|
||||
while( ( $t, $v ) = each %buffer ) {
|
||||
$v =~ s/null//g;
|
||||
|
||||
if( $data[2] =~ /FHEMDEVICE:/ ) {
|
||||
|
||||
$data[2] =~ s/FHEMDEVICE: //;
|
||||
my $chash = $defs{$data[2]};
|
||||
|
||||
while( ( $t, $v ) = each %buffer ) {
|
||||
$v =~ s/null//g;
|
||||
|
||||
readingsBeginUpdate( $chash );
|
||||
readingsBulkUpdate( $chash, $t, $v ) if( defined( $v ) );
|
||||
}
|
||||
readingsBeginUpdate( $chash );
|
||||
readingsBulkUpdate( $chash, $t, $v ) if( defined( $v ) );
|
||||
}
|
||||
|
||||
readingsBulkUpdate( $chash, "lastStatusRequestState", "statusRequest_done" );
|
||||
readingsEndUpdate( $chash, 1 );
|
||||
readingsBulkUpdate( $chash, "lastStatusRequestState", "statusRequest_done" );
|
||||
readingsEndUpdate( $chash, 1 );
|
||||
|
||||
} else {
|
||||
$data[3] =~ s/FHEMDEVICE: //;
|
||||
my $chash = $defs{$data[3]};
|
||||
|
||||
while( ( $t, $v ) = each %buffer ) {
|
||||
$v =~ s/null//g;
|
||||
|
||||
readingsBeginUpdate( $chash );
|
||||
readingsBulkUpdate( $chash, $t, $v ) if( defined( $v ) );
|
||||
}
|
||||
|
||||
readingsBulkUpdate( $chash, "lastStatusRequestState", "statusRequest_done" );
|
||||
readingsEndUpdate( $chash, 1 );
|
||||
|
||||
}
|
||||
|
||||
### End Response Processing
|
||||
|
||||
return;
|
||||
@ -947,10 +970,20 @@ sub AMAD_CommBridge_Read($) {
|
||||
elsif ( $data[0] =~ /FHEMCMD: statusrequest\b/ ) {
|
||||
|
||||
@data = split( '\R', $data[0] );
|
||||
$data[2] =~ s/FHEMDEVICE: //;
|
||||
my $chash = $defs{$data[2]};
|
||||
if( $data[2] =~ /FHEMDEVICE:/ ) {
|
||||
|
||||
$data[2] =~ s/FHEMDEVICE: //;
|
||||
my $chash = $defs{$data[2]};
|
||||
|
||||
return AMAD_GetUpdateLocal( $chash );
|
||||
|
||||
return AMAD_GetUpdateLocal( $chash );
|
||||
} else {
|
||||
$data[3] =~ s/FHEMDEVICE: //;
|
||||
my $chash = $defs{$data[3]};
|
||||
|
||||
return AMAD_GetUpdateLocal( $chash );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user