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:
parent
7258542f91
commit
8c79cfbc45
@ -18,6 +18,7 @@ sub RESIDENTS_Initialize($) {
|
|||||||
$hash->{AttrFn} = "RESIDENTStk_Attr";
|
$hash->{AttrFn} = "RESIDENTStk_Attr";
|
||||||
$hash->{NotifyFn} = "RESIDENTStk_Notify";
|
$hash->{NotifyFn} = "RESIDENTStk_Notify";
|
||||||
|
|
||||||
|
$hash->{'.READY'} = 0;
|
||||||
$hash->{NotifyOrderPrefix} = "45-";
|
$hash->{NotifyOrderPrefix} = "45-";
|
||||||
$hash->{AttrList} =
|
$hash->{AttrList} =
|
||||||
"disable:1,0 disabledForIntervals do_not_notify:1,0 "
|
"disable:1,0 disabledForIntervals do_not_notify:1,0 "
|
||||||
|
@ -19,6 +19,7 @@ sub GUEST_Initialize($) {
|
|||||||
$hash->{AttrFn} = "RESIDENTStk_Attr";
|
$hash->{AttrFn} = "RESIDENTStk_Attr";
|
||||||
$hash->{NotifyFn} = "RESIDENTStk_Notify";
|
$hash->{NotifyFn} = "RESIDENTStk_Notify";
|
||||||
|
|
||||||
|
$hash->{'.READY'} = 0;
|
||||||
$hash->{NotifyOrderPrefix} = "35-";
|
$hash->{NotifyOrderPrefix} = "35-";
|
||||||
$hash->{AttrList} =
|
$hash->{AttrList} =
|
||||||
"disable:1,0 disabledForIntervals do_not_notify:1,0 "
|
"disable:1,0 disabledForIntervals do_not_notify:1,0 "
|
||||||
|
@ -19,6 +19,7 @@ sub ROOMMATE_Initialize($) {
|
|||||||
$hash->{AttrFn} = "RESIDENTStk_Attr";
|
$hash->{AttrFn} = "RESIDENTStk_Attr";
|
||||||
$hash->{NotifyFn} = "RESIDENTStk_Notify";
|
$hash->{NotifyFn} = "RESIDENTStk_Notify";
|
||||||
|
|
||||||
|
$hash->{'.READY'} = 0;
|
||||||
$hash->{NotifyOrderPrefix} = "40-";
|
$hash->{NotifyOrderPrefix} = "40-";
|
||||||
$hash->{AttrList} =
|
$hash->{AttrList} =
|
||||||
"disable:1,0 disabledForIntervals do_not_notify:1,0 "
|
"disable:1,0 disabledForIntervals do_not_notify:1,0 "
|
||||||
|
@ -1084,14 +1084,13 @@ sub RESIDENTStk_Notify($$) {
|
|||||||
|
|
||||||
# init RESIDENTS, ROOMMATE or GUEST devices after boot
|
# init RESIDENTS, ROOMMATE or GUEST devices after boot
|
||||||
if ( $_ =~
|
if ( $_ =~
|
||||||
m/^INITIALIZED|REREADCFG|DEFINED.+|MODIFIED.+|RENAMED.+|DELETED.+$/
|
m/^(INITIALIZED|REREADCFG|DEFINED|MODIFIED|RENAMED|DELETED)(?:\s+(.*))?$/
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
RESIDENTStk_findResidentSlaves($hash)
|
RESIDENTStk_findResidentSlaves($hash)
|
||||||
if ( $TYPE eq "RESIDENTS" );
|
if ( $TYPE eq "RESIDENTS" );
|
||||||
RESIDENTStk_findDummySlaves($name)
|
RESIDENTStk_findDummySlaves($name)
|
||||||
if ( $TYPE ne "RESIDENTS" && $TYPE ne "dummy" );
|
if ( $TYPE ne "RESIDENTS" && $TYPE ne "dummy" );
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# only process attribute events
|
# only process attribute events
|
||||||
@ -3530,6 +3529,16 @@ sub RESIDENTStk_findDummySlaves($) {
|
|||||||
$hash->{NOTIFYDEV} .= $d;
|
$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($) {
|
sub RESIDENTStk_GetPrefixFromType($) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user