DuoFernGateway/module_private.php
/**
     * Updates parent data, buffers parents instance id and register/unregister msgs
     *
     * @return int parent instance id
     */
Updates parent data, buffers parents instance id and register/unregister msgs
@return int parent instance id
Updates parent data buffers parents instance id and register / unregister msgs @return int parent instance id
private function UpdateParentData()
    {
        $oldParentId = $this->ParentInstanceID;
        $parentId = IPS_GetInstance($this->InstanceID)['ConnectionID'];
        if ($parentId == $oldParentId) {
            return $parentId;
        }
        if ($oldParentId > 0) {
            $this->UnregisterMessage($oldParentId, IM_CHANGESTATUS);
        }
        if ($parentId > 0) {
            $this->RegisterMessage($parentId, IM_CHANGESTATUS);
        } else {
            $parentId = 0;
        }
        $this->ParentInstanceID = $parentId;
        return $parentId;
    }
private function UpdateParentData ( ) { $ oldParentId = $ this -> ParentInstanceID ; $ parentId = IPS_GetInstance ( $ this -> InstanceID ) [ 'ConnectionID' ] ; if ( $ parentId == $ oldParentId ) { return $ parentId ; } if ( $ oldParentId > 0 ) { $ this -> UnregisterMessage ( $ oldParentId , IM_CHANGESTATUS ) ; } if ( $ parentId > 0 ) { $ this -> RegisterMessage ( $ parentId , IM_CHANGESTATUS ) ; } else { $ parentId = 0 ; } $ this -> ParentInstanceID = $ parentId ; return $ parentId ; }
Updates parent data, buffers parents instance id and register/unregister msgs
 @return int parent instance id
Updates parent data buffers parents instance id and register / unregister msgs @return int parent instance id
// no parent change // unregister messages at old parent // unregister messages // register messages at new parent // register messages