-fix: bug connextionstate

-fix: bug connectionstate and reconnect after disconnected gateway
This commit is contained in:
2019-05-02 12:38:22 +02:00
parent e7e4634a53
commit 9bde01610d
2 changed files with 4 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ use SetExtensions;
sub XiaomiSmartHome_updateSingleReading($$); sub XiaomiSmartHome_updateSingleReading($$);
my $iv="\x17\x99\x6d\x09\x3d\x28\xdd\xb3\xba\x69\x5a\x2e\x6f\x58\x56\x2e"; my $iv="\x17\x99\x6d\x09\x3d\x28\xdd\xb3\xba\x69\x5a\x2e\x6f\x58\x56\x2e";
my $version = "1.40"; my $version = "1.41";
my %XiaomiSmartHome_gets = ( my %XiaomiSmartHome_gets = (
"getDevices" => ["get_id_list", '^.+get_id_list_ack' ], "getDevices" => ["get_id_list", '^.+get_id_list_ack' ],
@@ -442,7 +442,7 @@ sub XiaomiSmartHome_Write($@)
my ($hash,$cmd,$val,$iohash) = @_; my ($hash,$cmd,$val,$iohash) = @_;
my $name = $hash->{NAME}; my $name = $hash->{NAME};
if ( $hash->{helper}{ConnectionState} eq 'Disconnected') { if ( $hash->{helper}{ConnectionState} eq 'Disconnected') {
Log3 $name, 1, "$name: Write> Cannot write iam disconnected"; Log3 $name, 1, "$name: Write> Cannot write iam Disconnected";
return undef; return undef;
} }
else{ else{
@@ -575,7 +575,7 @@ sub XiaomiSmartHome_Ready($)
my ($hash) = @_; my ($hash) = @_;
# Versuch eines Verbindungsaufbaus, sofern die Verbindung beendet ist. # Versuch eines Verbindungsaufbaus, sofern die Verbindung beendet ist.
return DevIo_OpenDev($hash, 1, undef ) if ( $hash->{STATE} eq "disconnected" ); return DevIo_OpenDev($hash, 1, undef ) if ( $hash->{helper}{ConnectionState} eq "Disconnected" );
# This is relevant for Windows/USB only # This is relevant for Windows/USB only
if(defined($hash->{USBDev})) { if(defined($hash->{USBDev})) {

View File

@@ -1,2 +1,2 @@
UPD 2019-03-20_11:54:55 40740 FHEM/71_XiaomiSmartHome.pm UPD 2019-04-26 11:40:51 40758 FHEM/71_XiaomiSmartHome.pm
UPD 2019-03-20_11:32:54 30100 FHEM/71_XiaomiSmartHome_Device.pm UPD 2019-03-20_11:32:54 30100 FHEM/71_XiaomiSmartHome_Device.pm