2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-08 19:32:42 +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:
markooldenburg 2015-11-04 21:34:26 +00:00
parent 2a8f93e626
commit 30c35505cc
2 changed files with 47 additions and 13 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # 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 - feature: fhem_codemirror: Added DOIF autocomplete-keywords. Added feature
to autocomplete on any keypress. to autocomplete on any keypress.
- change: ATTENTION: Removed deprecated module 75_MSG.pm. Users will need to - change: ATTENTION: Removed deprecated module 75_MSG.pm. Users will need to

View File

@ -35,7 +35,7 @@ use Time::HiRes qw(gettimeofday);
use HttpUtils; use HttpUtils;
use TcpServerUtils; 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 @data = split( '\R\R', $buf );
my $chash = undef;
if ( $data[0] =~ /FHEMCMD: setreading\b/ ) { if ( $data[0] =~ /FHEMCMD: setreading\b/ ) {
my $tv = $data[1]; my $tv = $data[1];
@data = split( '\R', $data[0] ); @data = split( '\R', $data[0] );
$data[2] =~ s/FHEMDEVICE: //;
my $chash = $defs{$data[2]};
### Begin Response Processing ### Begin Response Processing
my @valuestring = split( '@@@@', $tv ); my @valuestring = split( '@@@@', $tv );
@ -913,15 +913,38 @@ sub AMAD_CommBridge_Read($) {
my $t; my $t;
my $v; my $v;
while( ( $t, $v ) = each %buffer ) {
$v =~ s/null//g;
readingsBeginUpdate( $chash ); if( $data[2] =~ /FHEMDEVICE:/ ) {
readingsBulkUpdate( $chash, $t, $v ) if( defined( $v ) );
} $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 ) );
}
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 );
}
readingsBulkUpdate( $chash, "lastStatusRequestState", "statusRequest_done" );
readingsEndUpdate( $chash, 1 );
### End Response Processing ### End Response Processing
return; return;
@ -947,10 +970,20 @@ sub AMAD_CommBridge_Read($) {
elsif ( $data[0] =~ /FHEMCMD: statusrequest\b/ ) { elsif ( $data[0] =~ /FHEMCMD: statusrequest\b/ ) {
@data = split( '\R', $data[0] ); @data = split( '\R', $data[0] );
$data[2] =~ s/FHEMDEVICE: //; if( $data[2] =~ /FHEMDEVICE:/ ) {
my $chash = $defs{$data[2]};
return AMAD_GetUpdateLocal( $chash ); $data[2] =~ s/FHEMDEVICE: //;
my $chash = $defs{$data[2]};
return AMAD_GetUpdateLocal( $chash );
} else {
$data[3] =~ s/FHEMDEVICE: //;
my $chash = $defs{$data[3]};
return AMAD_GetUpdateLocal( $chash );
}
} }
} }