From 925036be21f8e4f2a1a07a08b63ccec5921f0b81 Mon Sep 17 00:00:00 2001 From: Risiko <> Date: Sun, 7 Jan 2018 12:39:15 +0000 Subject: [PATCH] 98_weekprofile.pm: new set command 'reread_master' git-svn-id: https://svn.fhem.de/fhem/trunk@15811 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/CHANGED | 1 + fhem/FHEM/98_weekprofile.pm | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/fhem/CHANGED b/fhem/CHANGED index 14838ba63..f147dc42a 100644 --- a/fhem/CHANGED +++ b/fhem/CHANGED @@ -1,5 +1,6 @@ # 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. + - feature: 98_weekprofile.pm: new set command 'reread_master' - change: 10_SOMFY: minor changes remvoe debug and add parsestate reading - bugfix: 74_XiaomiFlowerSens: fix error then use ssh and no connect - change: 72_FB_CALLIST: mapping tables (icon-mapping, external-mapping,...) diff --git a/fhem/FHEM/98_weekprofile.pm b/fhem/FHEM/98_weekprofile.pm index 6dff89454..1c17afd4d 100644 --- a/fhem/FHEM/98_weekprofile.pm +++ b/fhem/FHEM/98_weekprofile.pm @@ -929,6 +929,22 @@ sub weekprofile_Set($$@) return undef; } + #---------------------------------------------------------- + $list.= " reread_master:noArg" if (defined($hash->{MASTERDEV})); + if ($cmd eq 'reread_master') { + return "Error no master device assigned" if (!defined($hash->{MASTERDEV})); + my $devName = $hash->{MASTERDEV}->{NAME}; + Log3 $me, 4, "$me(Set): reread master profile from $devName"; + my $prfDev = weekprofile_readDevProfile($hash->{MASTERDEV}->{NAME},$hash->{MASTERDEV}->{TYPE}, $me); + if(defined($prfDev)) { + $hash->{PROFILES}[0]->{DATA} = $prfDev; + weekprofile_updateReadings($hash); + return undef; + } else { + return "Error reading master profile"; + } + } + $list =~ s/ $//; return "Unknown argument $cmd, choose one of $list"; } @@ -1378,6 +1394,9 @@ sub weekprofile_getEditLNK_MasterDev($$) All weekprofiles from the topic will be transfered to the correcponding devices. Therefore a user attribute 'weekprofile' with the weekprofile name without the topic name have to exist in the device. +