2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

10_CUL_HM:allow sunset in on-till

git-svn-id: https://svn.fhem.de/fhem/trunk@7985 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
martinp876 2015-02-14 18:14:36 +00:00
parent 2f7718d05e
commit 9958037313

View File

@ -1842,6 +1842,15 @@ sub CUL_HM_Parse($$) {#########################################################
push @evtEt,[$devH,1,"state:$btnName $state$target"]; push @evtEt,[$devH,1,"state:$btnName $state$target"];
if($md eq "HM-Dis-WM55"){ if($md eq "HM-Dis-WM55"){
my $type = $trigType eq "Short"?"s":"l"; my $type = $trigType eq "Short"?"s":"l";
if ($devH->{cmdStack}){# there are pending commands. we only send new ones
delete $devH->{cmdStack};
delete $devH->{helper}{prt}{rspWait};
delete $devH->{helper}{prt}{rspWaitSec};
delete $devH->{helper}{prt}{mmcA};
delete $devH->{helper}{prt}{mmcS};
delete $devH->{lastMsg};
}
CUL_HM_calcDisWm($chnHash,$devH->{NAME},($trigType eq "Long"?"l":"s")); CUL_HM_calcDisWm($chnHash,$devH->{NAME},($trigType eq "Long"?"l":"s"));
CUL_HM_PushCmdStack($shash,"++A011$id$src$_")foreach (@{$chnHash->{helper}{disp}{$type}}); CUL_HM_PushCmdStack($shash,"++A011$id$src$_")foreach (@{$chnHash->{helper}{disp}{$type}});
} }
@ -3736,8 +3745,7 @@ sub CUL_HM_Set($@) {#+++++++++++++++++ set command+++++++++++++++++++++++++++++
my (undef,undef,$duration,$ramp) = @a; #date prepared extention to entdate my (undef,undef,$duration,$ramp) = @a; #date prepared extention to entdate
if ($cmd eq "on-till"){ if ($cmd eq "on-till"){
# to be extended to handle end date as well # to be extended to handle end date as well
my ($eH,$eM,$eSec) = split(':',$duration.":00:00"); my (undef,$eH,$eM,$eSec) = GetTimeSpec($duration);
return "please enter time informat hh:mm:ss" if (!$eSec);
$eSec += $eH*3600 + $eM*60; $eSec += $eH*3600 + $eM*60;
my @lt = localtime; my @lt = localtime;
my $ltSec = $lt[2]*3600+$lt[1]*60+$lt[0];# actually strip of date my $ltSec = $lt[2]*3600+$lt[1]*60+$lt[0];# actually strip of date