DuoFernGateway/module_private.php
/**
     * Updates children data, buffers children instance ids and register/unregister msgs
     *
     * @return int[] parent instance id
     */
Updates children data, buffers children instance ids and register/unregister msgs
@return int[] parent instance id
Updates children data buffers children instance ids and register / unregister msgs @return int [] parent instance id
private function UpdateChildrenData()
    {
        $oldChildrenIds = $this->ChildrenInstanceIDs;
        $childrenIds = IPS_GetInstanceListByModuleID("{BE62B172-BABA-4EB1-8C4C-507526645ED5}");
        foreach ($childrenIds as $key => $childId) {
            if (IPS_GetInstance($childId) ['ConnectionID'] != $this->InstanceID) {
                unset($childrenIds[$key]);
            }
        }
        if ($childrenIds == $oldChildrenIds) {
            return $childrenIds;
        }
        foreach (array_diff($oldChildrenIds, $childrenIds) as $oldChildId) {
            if ($oldChildId > 0) {
                $this->UnregisterMessage($oldChildId, IM_CHANGESETTINGS);
                $this->UnregisterMessage($oldChildId, FM_DISCONNECT);
            }
        }
        foreach (array_diff($childrenIds, $oldChildrenIds) as $childId) {
            if ($childId > 0) {
                $this->RegisterMessage($childId, IM_CHANGESETTINGS);
                $this->RegisterMessage($childId, FM_DISCONNECT);
            }
        }
        $this->ChildrenInstanceIDs = $childrenIds;
        return $childrenIds;
    }
private function UpdateChildrenData ( ) { $ oldChildrenIds = $ this -> ChildrenInstanceIDs ; $ childrenIds = IPS_GetInstanceListByModuleID ( " {BE62B172-BABA-4EB1-8C4C-507526645ED5} " ) ; foreach ( $ childrenIds as $ key => $ childId ) { if ( IPS_GetInstance ( $ childId ) [ 'ConnectionID' ] != $ this -> InstanceID ) { unset ( $ childrenIds [ $ key ] ) ; } } if ( $ childrenIds == $ oldChildrenIds ) { return $ childrenIds ; } foreach ( array_diff ( $ oldChildrenIds , $ childrenIds ) as $ oldChildId ) { if ( $ oldChildId > 0 ) { $ this -> UnregisterMessage ( $ oldChildId , IM_CHANGESETTINGS ) ; $ this -> UnregisterMessage ( $ oldChildId , FM_DISCONNECT ) ; } } foreach ( array_diff ( $ childrenIds , $ oldChildrenIds ) as $ childId ) { if ( $ childId > 0 ) { $ this -> RegisterMessage ( $ childId , IM_CHANGESETTINGS ) ; $ this -> RegisterMessage ( $ childId , FM_DISCONNECT ) ; } } $ this -> ChildrenInstanceIDs = $ childrenIds ; return $ childrenIds ; }
Updates children data, buffers children instance ids and register/unregister msgs
 @return int[] parent instance id
Updates children data buffers children instance ids and register / unregister msgs @return int [] parent instance id
// ignore instances if they are not children // no children changes // unregister messages at old children // unregister messages // register messages at new children // register messages