2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

RESIDENTS: send global events after module internal initialization and modification

git-svn-id: https://svn.fhem.de/fhem/trunk@14063 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
jpawlowski 2017-04-21 19:19:05 +00:00
parent 7258542f91
commit 8c79cfbc45
4 changed files with 14 additions and 2 deletions

View File

@ -18,6 +18,7 @@ sub RESIDENTS_Initialize($) {
$hash->{AttrFn} = "RESIDENTStk_Attr";
$hash->{NotifyFn} = "RESIDENTStk_Notify";
$hash->{'.READY'} = 0;
$hash->{NotifyOrderPrefix} = "45-";
$hash->{AttrList} =
"disable:1,0 disabledForIntervals do_not_notify:1,0 "

View File

@ -19,6 +19,7 @@ sub GUEST_Initialize($) {
$hash->{AttrFn} = "RESIDENTStk_Attr";
$hash->{NotifyFn} = "RESIDENTStk_Notify";
$hash->{'.READY'} = 0;
$hash->{NotifyOrderPrefix} = "35-";
$hash->{AttrList} =
"disable:1,0 disabledForIntervals do_not_notify:1,0 "

View File

@ -19,6 +19,7 @@ sub ROOMMATE_Initialize($) {
$hash->{AttrFn} = "RESIDENTStk_Attr";
$hash->{NotifyFn} = "RESIDENTStk_Notify";
$hash->{'.READY'} = 0;
$hash->{NotifyOrderPrefix} = "40-";
$hash->{AttrList} =
"disable:1,0 disabledForIntervals do_not_notify:1,0 "

View File

@ -1084,14 +1084,13 @@ sub RESIDENTStk_Notify($$) {
# init RESIDENTS, ROOMMATE or GUEST devices after boot
if ( $_ =~
m/^INITIALIZED|REREADCFG|DEFINED.+|MODIFIED.+|RENAMED.+|DELETED.+$/
m/^(INITIALIZED|REREADCFG|DEFINED|MODIFIED|RENAMED|DELETED)(?:\s+(.*))?$/
)
{
RESIDENTStk_findResidentSlaves($hash)
if ( $TYPE eq "RESIDENTS" );
RESIDENTStk_findDummySlaves($name)
if ( $TYPE ne "RESIDENTS" && $TYPE ne "dummy" );
return "";
}
# only process attribute events
@ -3530,6 +3529,16 @@ sub RESIDENTStk_findDummySlaves($) {
$hash->{NOTIFYDEV} .= $d;
}
}
# finish initialization
if ( $hash->{'.READY'} ) {
DoTrigger( "global", "MODIFIED $name", 1 );
}
else {
$hash->{'.READY'} = 1;
DoTrigger( "global", "INITIALIZED $name", 1 );
}
return "";
}
sub RESIDENTStk_GetPrefixFromType($) {