fix: missing curlybracket

oooopps shit somthing wrong
This commit is contained in:
2017-04-03 22:34:33 +02:00
parent 383cf54998
commit 34a81d549d
2 changed files with 13 additions and 16 deletions

View File

@@ -25,7 +25,7 @@ package main;
use strict; use strict;
use warnings; use warnings;
my $version = "0.10"; my $version = "0.11";
sub XiaomiSmartHome_Device_updateSReading($); sub XiaomiSmartHome_Device_updateSReading($);
##################################### #####################################
@@ -98,7 +98,6 @@ sub XiaomiSmartHome_Device_on_timeout($){
sub XiaomiSmartHome_Device_Read($$$){ sub XiaomiSmartHome_Device_Read($$$){
my ($hash, $msg, $name) = @_; my ($hash, $msg, $name) = @_;
my $decoded = decode_json($msg); my $decoded = decode_json($msg);
my $sid = $decoded->{'sid'}; my $sid = $decoded->{'sid'};
my $model = $decoded->{'model'}; my $model = $decoded->{'model'};
Log3 $name, 5, "$name: SID: " . $hash->{SID} . " " . $hash->{TYPE}; Log3 $name, 5, "$name: SID: " . $hash->{SID} . " " . $hash->{TYPE};
@@ -113,6 +112,7 @@ sub XiaomiSmartHome_Device_Read($$$){
if ($data->{status} eq 'close' && $hash->{MODEL} eq 'magnet'){ if ($data->{status} eq 'close' && $hash->{MODEL} eq 'magnet'){
readingsBulkUpdate($hash, "no_close", "0", 1 ); readingsBulkUpdate($hash, "no_close", "0", 1 );
} }
}
if (defined $data->{no_motion}){ if (defined $data->{no_motion}){
Log3 $name, 3, "$name>" . " SID: " . $sid . " Type: " . $hash->{MODEL} . " NO_motion: " . $data->{no_motion}; Log3 $name, 3, "$name>" . " SID: " . $sid . " Type: " . $hash->{MODEL} . " NO_motion: " . $data->{no_motion};
readingsBulkUpdate($hash, "no_motion", "$data->{no_motion}", 1 ); readingsBulkUpdate($hash, "no_motion", "$data->{no_motion}", 1 );
@@ -161,15 +161,12 @@ sub XiaomiSmartHome_Device_Read($$$){
readingsBulkUpdate($hash, "rotate", "$data->{rotate}", 1 ); readingsBulkUpdate($hash, "rotate", "$data->{rotate}", 1 );
} }
#cube end #cube end
}
if ($decoded->{'cmd'} eq 'heartbeat'){ if ($decoded->{'cmd'} eq 'heartbeat'){
readingsBulkUpdate($hash, 'heartbeat', $decoded->{'sid'} , 1 ); readingsBulkUpdate($hash, 'heartbeat', $decoded->{'sid'} , 1 );
} }
readingsEndUpdate( $hash, 1 ); readingsEndUpdate( $hash, 1 );
XiaomiSmartHome_Device_update($hash); XiaomiSmartHome_Device_update($hash);
return $hash->{NAME}; return $hash->{NAME};
} }
##################################### #####################################

View File

@@ -1,2 +1,2 @@
UPD 2017-04-03_14:31:37 15333 FHEM/71_XiaomiSmartHome.pm UPD 2017-04-03_14:31:37 15333 FHEM/71_XiaomiSmartHome.pm
UPD 2017-04-03_14:31:24 10000 FHEM/71_XiaomiSmartHome_Device.pm UPD 2017-04-03_22:28:16 10007 FHEM/71_XiaomiSmartHome_Device.pm