From 75108ff5d3ae395ff09359d0c7c59c0a61a26fa5 Mon Sep 17 00:00:00 2001 From: Marko Oldenburg Date: Sat, 17 Mar 2018 12:09:19 +0100 Subject: [PATCH] new set command resetBatteryTimestamp --- 74_CometBlueBTLE.pm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/74_CometBlueBTLE.pm b/74_CometBlueBTLE.pm index 4ad125a..3026ffa 100644 --- a/74_CometBlueBTLE.pm +++ b/74_CometBlueBTLE.pm @@ -55,7 +55,7 @@ eval "use Blocking;1" or $missingModul .= "Blocking "; -my $version = "0.1.40"; +my $version = "0.1.41"; @@ -277,7 +277,7 @@ sub CometBlueBTLE_Notify($$) { return if (!$events); - CometBlueBTLE_stateRequestTimer($hash) if( (grep /^DEFINED.$name$/,@{$events} + CometBlueBTLE_stateRequestTimer($hash) if( (((grep /^DEFINED.$name$/,@{$events} or grep /^INITIALIZED$/,@{$events} or grep /^MODIFIED.$name$/,@{$events} or grep /^DELETEATTR.$name.disable$/,@{$events} @@ -285,7 +285,8 @@ sub CometBlueBTLE_Notify($$) { or grep /^DELETEATTR.$name.interval$/,@{$events} or grep /^DELETEATTR.$name.model$/,@{$events} or grep /^ATTR.$name.model.+/,@{$events} - or grep /^ATTR.$name.interval.[0-9]+/,@{$events} ) and $init_done and $devname eq 'global' ); + or grep /^ATTR.$name.interval.[0-9]+/,@{$events}) and $devname eq 'global') + or grep /^resetBatteryTimestamp$/,@{$events}) and $init_done ); return; } @@ -380,6 +381,12 @@ sub CometBlueBTLE_Set($$@) { $handle = $gatttChar{AttrVal($name,'model','')}{'payload'}; $value = join( " ", @args); + + } elsif( $cmd eq 'resetBatteryTimestamp' ) { + return "usage: resetBatteryTimestamp" if( @args != 0 ); + + $hash->{helper}{updateTimeCallBattery} = 0; + return; } else { my $list = "desired-temp:on,off,Eco,Comfort,8.5,9.0,9.5,10.0,10.5,11.0,11.5,12.0,12.5,13.0,13.5,14.0,14.5,15.0,15.5,16.0,16.5,17.0,17.5,18.0,18.5,19.0,19.5,20.0,20.5,21.0,21.5,22.0,22.5,23.0,23.5,24.0,24.5,25.0,25.5,26.0,26.5,27.0,27.5";