From f7645e13b052c488f5fc4e70afdb76531746c633 Mon Sep 17 00:00:00 2001 From: Risiko <> Date: Wed, 26 Oct 2022 20:01:40 +0000 Subject: [PATCH] 98_weekprofile: fix create reference profile from an other referenced profile - thx Beta-User #msg1239098 git-svn-id: https://svn.fhem.de/fhem/trunk@26594 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 2 ++ fhem/FHEM/98_weekprofile.pm | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/fhem/CHANGED b/fhem/CHANGED index fc1b91dd4..2725c82da 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,7 @@ # Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # Do not insert empty lines here, update check depends on it. + - bugfix: 98_weekprofile:create reference profile + from an other referenced profile - feature: 70_ESCVP21net: added 2-value commands - change: 88_HMCCU: Minor improvements - feature: 70_ESCVP21net: added LS12000 (with POPLP, LENS, HLENS) diff --git a/fhem/FHEM/98_weekprofile.pm b/fhem/FHEM/98_weekprofile.pm index 675d85084..dcf7cd261 100644 --- a/fhem/FHEM/98_weekprofile.pm +++ b/fhem/FHEM/98_weekprofile.pm @@ -1172,7 +1172,13 @@ sub weekprofile_Set($$@) my $prfDest = undef; foreach my $prf (@{$hash->{PROFILES}}){ $prfSrc = $prf if ( ($prf->{NAME} eq $srcName) && ($prf->{TOPIC} eq $srcTopic) ); + my ($prf2,undef) = weekprofile_findPRF($hash,$srcName,$srcTopic,0); + if ( $prf2 && defined $prf2->{REF} ) { + ($srcTopic, $srcName) = weekprofile_splitName($me, $prf2->{REF}); + $prfSrc = $prf2; + } $prfDest = $prf if ( ($prf->{NAME} eq $destName) && ($prf->{TOPIC} eq $destTopic) ); + last if defined $prfSrc && defined $prfDest; } return "Error unknown profile $srcName" unless($prfSrc); Log3($me, 4, "$me(Set): override profile $destName") if ($prfDest);