mirror of
https://github.com/fhem/fhem-mirror.git
synced 2025-04-19 18:56:03 +00:00
98_Weekdaytimer, 98_Heating_Control: issue because of version 5.7 @, % change in EvalSpecials()
git-svn-id: https://svn.fhem.de/fhem/trunk@9915 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
parent
ad76767f9d
commit
2ed2b970d0
@ -177,7 +177,6 @@ sub WeekdayTimer_Define($$) {
|
|||||||
sub WeekdayTimer_Profile($) {
|
sub WeekdayTimer_Profile($) {
|
||||||
my $hash = shift;
|
my $hash = shift;
|
||||||
|
|
||||||
my $nochZuAendern = 0; # $d
|
|
||||||
my $language = $hash->{LANGUAGE};
|
my $language = $hash->{LANGUAGE};
|
||||||
my %longDays = %{$hash->{longDays}};
|
my %longDays = %{$hash->{longDays}};
|
||||||
|
|
||||||
@ -194,11 +193,7 @@ sub WeekdayTimer_Profile($) {
|
|||||||
foreach my $d (@{$tage}) {
|
foreach my $d (@{$tage}) {
|
||||||
|
|
||||||
my @listeDerTage = ($d);
|
my @listeDerTage = ($d);
|
||||||
push (@listeDerTage, (0, 6) ) if ($d==7); # sa,so ($we)
|
push (@listeDerTage, WeekdayTimer_getListeDerTage($d, $time)) if ($d>=7);
|
||||||
push (@listeDerTage, (1..5) ) if ($d==8); # mo-fr
|
|
||||||
|
|
||||||
# alle Tage prüfen hash anlegen mit d>1, d=>0
|
|
||||||
# wenn 0, dann nur auf Feiertag prüfen
|
|
||||||
|
|
||||||
map { my $day = $_;
|
map { my $day = $_;
|
||||||
my $dayOfEchteZeit = $day;
|
my $dayOfEchteZeit = $day;
|
||||||
@ -236,14 +231,47 @@ sub WeekdayTimer_Profile($) {
|
|||||||
Log3 $hash, 4, "[$hash->{NAME}] $profiltext ($profilKey)";
|
Log3 $hash, 4, "[$hash->{NAME}] $profiltext ($profilKey)";
|
||||||
}
|
}
|
||||||
|
|
||||||
#Log 3, $hash->{NAME} ."--->\n". Dumper $hash->{profile};
|
|
||||||
#Log 3, $hash->{NAME} ."--->\n". Dumper $hash->{profile_IDX};
|
|
||||||
|
|
||||||
# für logProxy umhaengen
|
# für logProxy umhaengen
|
||||||
$hash->{helper}{SWITCHINGTIME} = $hash->{profile};
|
$hash->{helper}{SWITCHINGTIME} = $hash->{profile};
|
||||||
delete $hash->{profile};
|
delete $hash->{profile};
|
||||||
}
|
}
|
||||||
################################################################################
|
################################################################################
|
||||||
|
sub WeekdayTimer_getListeDerTage($$) {
|
||||||
|
my ($d, $time) = @_;
|
||||||
|
|
||||||
|
my %hdays=();
|
||||||
|
@hdays{(0, 6)} = undef if ($d==7); # sa,so ( $we)
|
||||||
|
@hdays{(1..5)} = undef if ($d==8); # mo-fr (!$we)
|
||||||
|
|
||||||
|
my $wday;
|
||||||
|
my $now = time();
|
||||||
|
my ($sec,$min,$hour,$mday,$mon,$year,$nowWday,$yday,$isdst) = localtime($now);
|
||||||
|
|
||||||
|
my @realativeWdays = (0..6);
|
||||||
|
for (my $i=0;$i<=6;$i++) {
|
||||||
|
|
||||||
|
my $relativeDay = $i-$nowWday;
|
||||||
|
#Log 3, "relativeDay------------>$relativeDay";
|
||||||
|
my ($stunde, $minute, $sekunde) = split (":",$time);
|
||||||
|
|
||||||
|
my $echteZeit = WeekdayTimer_zeitErmitteln ($now, $stunde, $minute, $sekunde, $relativeDay);
|
||||||
|
#Log 3, "echteZeit---$i---->>>$relativeDay<<<----->".FmtDateTime($echteZeit);
|
||||||
|
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($echteZeit);
|
||||||
|
my $h2we = $attr{global}{holiday2we};
|
||||||
|
if($h2we) {
|
||||||
|
my $ergebnis = fhem("get $h2we ".sprintf("%02d-%02d",$mon+1,$mday),1);
|
||||||
|
if ($ergebnis ne "none") {
|
||||||
|
#Log 3, "ergebnis-------$i----->$ergebnis";
|
||||||
|
$hdays{$i} = undef if ($d==7); # $we Tag aufnehmen
|
||||||
|
delete $hdays{$i} if ($d==8); # !$we Tag herausnehmen
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#Log 3, "result------------>" . join (" ", sort keys %hdays);
|
||||||
|
return keys %hdays;
|
||||||
|
}
|
||||||
|
################################################################################
|
||||||
sub WeekdayTimer_SwitchingTime($$) {
|
sub WeekdayTimer_SwitchingTime($$) {
|
||||||
my ($hash, $switchingtime) = @_;
|
my ($hash, $switchingtime) = @_;
|
||||||
|
|
||||||
@ -810,7 +838,7 @@ sub WeekdayTimer_Device_Schalten($$$) {
|
|||||||
#modifier des Zieldevices auswaehlen
|
#modifier des Zieldevices auswaehlen
|
||||||
my $setModifier = WeekdayTimer_isHeizung($hash);
|
my $setModifier = WeekdayTimer_isHeizung($hash);
|
||||||
|
|
||||||
$command = "set @ " . $setModifier . " %";
|
$command = 'set $NAME ' . $setModifier . ' $EVENT';
|
||||||
$command = $hash->{COMMAND} if (defined $hash->{COMMAND});
|
$command = $hash->{COMMAND} if (defined $hash->{COMMAND});
|
||||||
|
|
||||||
my $activeTimer = 1;
|
my $activeTimer = 1;
|
||||||
@ -825,7 +853,9 @@ sub WeekdayTimer_Device_Schalten($$$) {
|
|||||||
Log3 $hash, 4, "[$name] aktParam:$aktParam newParam:$newParam - is $disabled_txt disabled";
|
Log3 $hash, 4, "[$name] aktParam:$aktParam newParam:$newParam - is $disabled_txt disabled";
|
||||||
|
|
||||||
#Kommando ausführen
|
#Kommando ausführen
|
||||||
if ($command && !$disabled && $aktParam ne $newParam && $activeTimer) {
|
if ($command && !$disabled && $activeTimer
|
||||||
|
&& $aktParam ne $newParam
|
||||||
|
) {
|
||||||
$newParam =~ s/:/ /g;
|
$newParam =~ s/:/ /g;
|
||||||
|
|
||||||
my %specials = ( "%NAME" => $hash->{DEVICE}, "%EVENT" => $newParam);
|
my %specials = ( "%NAME" => $hash->{DEVICE}, "%EVENT" => $newParam);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user