diff --git a/fhem/FHEM/36_PrecipitationSensor.pm b/fhem/FHEM/36_PrecipitationSensor.pm index 2c94d9827..dc1ee25d0 100644 --- a/fhem/FHEM/36_PrecipitationSensor.pm +++ b/fhem/FHEM/36_PrecipitationSensor.pm @@ -268,15 +268,7 @@ sub PrecipitationSensor_Ready($) { my ($hash) = @_; my $name = $hash->{NAME}; - PrecipitationSensor_Connect($hash, 1); - - # This is relevant for windows/USB only - my $po = $hash->{USBDev}; - my ($BlockingFlags, $InBytes, $OutBytes, $ErrorFlags); - if($po) { - ($BlockingFlags, $InBytes, $OutBytes, $ErrorFlags) = $po->status; - } - return ($InBytes && $InBytes>0); + return PrecipitationSensor_Connect($hash, 1); } #======================================================================================= @@ -409,8 +401,12 @@ sub PrecipitationSensor_Connect($;$) { my $enabled = AttrVal($name, "disable", "0") != "1" && !defined($hash->{helper}{FLASHING}); if($enabled) { $hash->{nextOpenDelay} = 2; - my $ret = DevIo_OpenDev($hash, $mode, "PrecipitationSensor_DoInit"); + my $ret = DevIo_OpenDev($hash, $mode, "PrecipitationSensor_DoInit", sub($$){ + my ($hash, $error) = @_; + ####Log 3, $hash->{NAME} . " " . $error; + }); return $ret; + } return undef;