def _cb_created(self, payload, duplicated):
        """Indirect callback (via Client) for point & subscription creation responses"""
        if payload[P_RESOURCE] in _POINT_TYPE_TO_CLASS:
            store = self.__new_feeds if payload[P_RESOURCE] == R_FEED else self.__new_controls
            cls = _POINT_TYPE_TO_CLASS[payload[P_RESOURCE]]
            with store:
                store[payload[P_LID]] = cls(self._client, payload[P_ENTITY_LID], payload[P_LID], payload[P_ID])
            logger.debug('Added %s: %s (for %s)', foc_to_str(payload[P_RESOURCE]), payload[P_LID],
                         payload[P_ENTITY_LID])

        elif payload[P_RESOURCE] == R_SUB:
            # local
            if P_POINT_ENTITY_LID in payload:
                key = (payload[P_POINT_TYPE], (payload[P_POINT_ENTITY_LID], payload[P_POINT_LID]))
            # global
            else:
                key = (payload[P_POINT_TYPE], payload[P_POINT_ID])

            new_subs = self.__new_subs
            with new_subs:
                if key in new_subs:
                    cls = RemoteFeed if payload[P_POINT_TYPE] == R_FEED else RemoteControl
                    new_subs[key] = cls(self._client, payload[P_ID], payload[P_POINT_ID], payload[P_ENTITY_LID])
                else:
                    logger.warning('Ignoring subscription creation for unexpected %s: %s',
                                   foc_to_str(payload[P_POINT_TYPE]), key[1])

        else:
            logger.error('Resource creation of type %d unhandled', payload[P_RESOURCE])
def _cb_created ( self , payload , duplicated ) : if payload [ P_RESOURCE ] in _POINT_TYPE_TO_CLASS : store = self . __new_feeds if payload [ P_RESOURCE ] == R_FEED else self . __new_controls cls = _POINT_TYPE_TO_CLASS [ payload [ P_RESOURCE ] ] with store : store [ payload [ P_LID ] ] = cls ( self . _client , payload [ P_ENTITY_LID ] , payload [ P_LID ] , payload [ P_ID ] ) logger . debug ( 'Added %s: %s (for %s)' , foc_to_str ( payload [ P_RESOURCE ] ) , payload [ P_LID ] , payload [ P_ENTITY_LID ] ) elif payload [ P_RESOURCE ] == R_SUB : if P_POINT_ENTITY_LID in payload : key = ( payload [ P_POINT_TYPE ] , ( payload [ P_POINT_ENTITY_LID ] , payload [ P_POINT_LID ] ) ) else : key = ( payload [ P_POINT_TYPE ] , payload [ P_POINT_ID ] ) new_subs = self . __new_subs with new_subs : if key in new_subs : cls = RemoteFeed if payload [ P_POINT_TYPE ] == R_FEED else RemoteControl new_subs [ key ] = cls ( self . _client , payload [ P_ID ] , payload [ P_POINT_ID ] , payload [ P_ENTITY_LID ] ) else : logger . warning ( 'Ignoring subscription creation for unexpected %s: %s' , foc_to_str ( payload [ P_POINT_TYPE ] ) , key [ 1 ] ) else : logger . error ( 'Resource creation of type %d unhandled' , payload [ P_RESOURCE ] )
Indirect callback (via Client) for point & subscription creation responses