2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-04-27 10:37:13 +00:00

98_weekprofile.pm: new set command 'reread_master'

git-svn-id: https://svn.fhem.de/fhem/trunk@15811 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
Risiko 2018-01-07 12:39:15 +00:00
parent 1cdb230a54
commit 925036be21
2 changed files with 23 additions and 0 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide. # 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. # 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 - change: 10_SOMFY: minor changes remvoe debug and add parsestate reading
- bugfix: 74_XiaomiFlowerSens: fix error then use ssh and no connect - bugfix: 74_XiaomiFlowerSens: fix error then use ssh and no connect
- change: 72_FB_CALLIST: mapping tables (icon-mapping, external-mapping,...) - change: 72_FB_CALLIST: mapping tables (icon-mapping, external-mapping,...)

View File

@ -929,6 +929,22 @@ sub weekprofile_Set($$@)
return undef; 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/ $//; $list =~ s/ $//;
return "Unknown argument $cmd, choose one of $list"; 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. All weekprofiles from the topic will be transfered to the correcponding devices.
Therefore a user attribute 'weekprofile' with the weekprofile name <b>without the topic name</b> have to exist in the device. Therefore a user attribute 'weekprofile' with the weekprofile name <b>without the topic name</b> have to exist in the device.
</li> </li>
<li>reread_master<br>
Refresh (reread) the master profile from the master device.
</li>
</ul> </ul>
<a name="weekprofileget"></a> <a name="weekprofileget"></a>
@ -1537,6 +1556,9 @@ sub weekprofile_getEditLNK_MasterDev($$)
Alle Wochenpläne in der Topic werden zu den entsprechenden Geräten übertragen. Alle Wochenpläne in der Topic werden zu den entsprechenden Geräten übertragen.
Dazu muss im Gerät ein Userattribut 'weekprofile' mit dem Namen des Wochenplans <b>ohne</b> Topic gesetzt sein. Dazu muss im Gerät ein Userattribut 'weekprofile' mit dem Namen des Wochenplans <b>ohne</b> Topic gesetzt sein.
</li> </li>
<li>reread_master<br>
Aktualisiert das master profile indem das 'Master-Geräte' neu ausgelesen wird.
</li>
</ul> </ul>
<a name="weekprofileget"></a> <a name="weekprofileget"></a>