From 9bde01610d2841707ed2dc1b2a295d3329d90087 Mon Sep 17 00:00:00 2001 From: Torte Date: Thu, 2 May 2019 12:38:22 +0200 Subject: [PATCH] -fix: bug connextionstate -fix: bug connectionstate and reconnect after disconnected gateway --- FHEM/71_XiaomiSmartHome.pm | 6 +++--- controls_mish.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/FHEM/71_XiaomiSmartHome.pm b/FHEM/71_XiaomiSmartHome.pm index 19e54a5..1133e84 100644 --- a/FHEM/71_XiaomiSmartHome.pm +++ b/FHEM/71_XiaomiSmartHome.pm @@ -48,7 +48,7 @@ use SetExtensions; sub XiaomiSmartHome_updateSingleReading($$); 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 = ( "getDevices" => ["get_id_list", '^.+get_id_list_ack' ], @@ -442,7 +442,7 @@ sub XiaomiSmartHome_Write($@) my ($hash,$cmd,$val,$iohash) = @_; my $name = $hash->{NAME}; 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; } else{ @@ -575,7 +575,7 @@ sub XiaomiSmartHome_Ready($) my ($hash) = @_; # 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 if(defined($hash->{USBDev})) { diff --git a/controls_mish.txt b/controls_mish.txt index 0d0987a..d92a733 100644 --- a/controls_mish.txt +++ b/controls_mish.txt @@ -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