change code

This commit is contained in:
Marko Oldenburg 2019-10-11 12:25:37 +02:00
parent 212741903c
commit c86303cc32

View File

@ -453,9 +453,7 @@ sub stateRequest($) {
elsif ( $hash->{helper}{CallSensDataCounter} < 1
and AttrVal( $name, 'model', '' ) eq 'clearGrassSens' )
{
CreateParamGatttool(
$hash,
'read',
CreateParamGatttool( $hash, 'read',
$XiaomiModels{ AttrVal( $name, 'model', '' ) }{rdata},
);
$hash->{helper}{CallSensDataCounter} =
@ -1113,7 +1111,9 @@ sub ClearGrassSensHandle0x1e($$) {
$notification =~ s/\s+//g;
$readings{'temperature'} = hex( substr( $notification, 4, 2 ) ) / 10;
$readings{'humidity'} = hex(substr($notification,11,1) .substr($notification,8,2))/10;
$readings{'humidity'} =
hex( substr( $notification, 11, 1 ) . substr( $notification, 8, 2 ) ) /
10;
$hash->{helper}{CallBattery} = 0;
return \%readings;
@ -1176,7 +1176,9 @@ sub WriteReadings($$) {
. ReadingsVal( $name, 'temperature', 0 ) . ' H: '
. ReadingsVal( $name, 'humidity', 0 )
)
) if ( AttrVal( $name, 'model', 'none' ) eq 'thermoHygroSens' );
)
if ( AttrVal( $name, 'model', 'none' ) eq 'thermoHygroSens'
or AttrVal( $name, 'model', 'none' ) eq 'clearGrassSens' );
readingsEndUpdate( $hash, 1 );