From e3ddbfdd82b43880d05ea43f53b1a11de2bbf9c6 Mon Sep 17 00:00:00 2001
From: rudolfkoenig <>
Date: Thu, 27 Jun 2019 05:33:17 +0000
Subject: [PATCH] fhem.pl: IsWe checks for noWeekEnd (Forum #101789)
git-svn-id: https://svn.fhem.de/fhem/trunk@19719 2b470e98-0d58-463d-a4d8-8e2adae1ed80
---
fhem/docs/commandref_frame.html | 5 +++--
fhem/docs/commandref_frame_DE.html | 4 +++-
fhem/fhem.pl | 5 ++++-
3 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/fhem/docs/commandref_frame.html b/fhem/docs/commandref_frame.html
index 9e2d8deb5..1e0300813 100644
--- a/fhem/docs/commandref_frame.html
+++ b/fhem/docs/commandref_frame.html
@@ -1552,8 +1552,9 @@ The following local attributes are used by a wider range of devices:
attr global holiday2we he
- Note: if one of the elements in the list is called weekEnd, then the
- check for saturday/sunday is skipped.
+ Note: if one of the elements in the list is named weekEnd, then the
+ check for saturday/sunday is skipped If the name is noWeekEnd, and
+ its Value is not none, than $we is 0.
diff --git a/fhem/docs/commandref_frame_DE.html b/fhem/docs/commandref_frame_DE.html
index 52319b3b9..90c7c721f 100644
--- a/fhem/docs/commandref_frame_DE.html
+++ b/fhem/docs/commandref_frame_DE.html
@@ -1654,7 +1654,9 @@ Die folgenden lokalen Attribute werden von mehreren Geräten verwendet:
attr global holiday2we hessen
Falls sich einer der Elemente dieser Liste weekEnd nennt, dann wird
- nicht auf Samstag/Sonntag geprüft.
+ nicht auf Samstag/Sonntag geprüft. Falls einer der Elemente
+ noWeekEnd ist, und nicht "none" zurückliefert, dann ist
+ $we 0.
diff --git a/fhem/fhem.pl b/fhem/fhem.pl
index f6271c8fb..a54992a46 100755
--- a/fhem/fhem.pl
+++ b/fhem/fhem.pl
@@ -5965,7 +5965,10 @@ IsWe(;$$)
my ($we, $wf);
foreach my $h2we (split(",", AttrVal("global", "holiday2we", ""))) {
my $b = ReadingsVal($h2we, $when, 0);
- $we = 1 if($b && $b ne "none");
+ if($b && $b ne "none") {
+ return 0 if($h2we eq "noWeekEnd");
+ $we = 1 if($b && $b ne "none");
+ }
$wf = 1 if($h2we eq "weekEnd");
}