platypush/plugins/autoremote/__init__.py
def send_message(self, msg, key=None, password=None, devices=None, target=None,
                     sender=None, ttl=None, group=None, *_, **__):
        """
        Sends a message to AutoRemote.

        :param msg: Message to send

        :param key: Set it if you want to override the default devices
            (default: None, message sent to all the configured devices)
        :type key: str

        :param password: Set it if you want to override the default password (default: None)
        :type password: str

        :param devices: Set it if you want to send the message to a specific list of
            configured devices (default: None, message sent to all the configured devices)
        :type devices: list

        :param target: Message target (default: None)
        :type target: str

        :param sender: Message sender (default: None)
        :type target: str

        :param ttl: Message time-to-live in seconds (default: None)
        :type ttl: int

        :param group: Message group name (default: None)
        :type group: str
        """
        if devices:
            target_devices = [self.devices[name] for name in self.devices.keys()
                              if name in devices]
        elif key:
            device = { 'key': key }
            if password:
                device['password'] = password

            target_devices = [device]
        else:
            target_devices = self.devices.values()

        for device in target_devices:
            args = {
                'message': msg,
                'key': device['key'],
                'sender': sender or Config.get('device_id'),
            }

            if device.get('password'):
                args['password'] = device['password']

            if target: args['target'] = target
            if ttl: args['ttl'] = ttl
            if group: args['collapseKey'] = group

            response = requests.post(self._AUTOREMOTE_MESSAGE_URL, data=args)
            self.logger.info('Received response from AutoRemote: {}'.format(response.text))

        Sends a message to AutoRemote.

        :param msg: Message to send

        :param key: Set it if you want to override the default devices
            (default: None, message sent to all the configured devices)
        :type key: str

        :param password: Set it if you want to override the default password (default: None)
        :type password: str

        :param devices: Set it if you want to send the message to a specific list of
            configured devices (default: None, message sent to all the configured devices)
        :type devices: list

        :param target: Message target (default: None)
        :type target: str

        :param sender: Message sender (default: None)
        :type target: str

        :param ttl: Message time-to-live in seconds (default: None)
        :type ttl: int

        :param group: Message group name (default: None)
        :type group: str
        
Sends a message to AutoRemote.
Sends a message to AutoRemote .
def send_message(self, msg, key=None, password=None, devices=None, target=None,
                     sender=None, ttl=None, group=None, *_, **__):
        if devices:
            target_devices = [self.devices[name] for name in self.devices.keys()
                              if name in devices]
        elif key:
            device = { 'key': key }
            if password:
                device['password'] = password
            target_devices = [device]
        else:
            target_devices = self.devices.values()
        for device in target_devices:
            args = {
                'message': msg,
                'key': device['key'],
                'sender': sender or Config.get('device_id'),
            }
            if device.get('password'):
                args['password'] = device['password']
            if target: args['target'] = target
            if ttl: args['ttl'] = ttl
            if group: args['collapseKey'] = group
            response = requests.post(self._AUTOREMOTE_MESSAGE_URL, data=args)
            self.logger.info('Received response from AutoRemote: {}'.format(response.text))
def send_message ( self , msg , key = None , password = None , devices = None , target = None , sender = None , ttl = None , group = None , * _ , ** __ ) : if devices : target_devices = [ self . devices [ name ] for name in self . devices . keys ( ) if name in devices ] elif key : device = { 'key' : key } if password : device [ 'password' ] = password target_devices = [ device ] else : target_devices = self . devices . values ( ) for device in target_devices : args = { 'message' : msg , 'key' : device [ 'key' ] , 'sender' : sender or Config . get ( 'device_id' ) , } if device . get ( 'password' ) : args [ 'password' ] = device [ 'password' ] if target : args [ 'target' ] = target if ttl : args [ 'ttl' ] = ttl if group : args [ 'collapseKey' ] = group response = requests . post ( self . _AUTOREMOTE_MESSAGE_URL , data = args ) self . logger . info ( 'Received response from AutoRemote: {}' . format ( response . text ) )
Sends a message to AutoRemote.
Sends a message to AutoRemote .
"""
        Sends a message to AutoRemote.

        :param msg: Message to send

        :param key: Set it if you want to override the default devices
            (default: None, message sent to all the configured devices)
        :type key: str

        :param password: Set it if you want to override the default password (default: None)
        :type password: str

        :param devices: Set it if you want to send the message to a specific list of
            configured devices (default: None, message sent to all the configured devices)
        :type devices: list

        :param target: Message target (default: None)
        :type target: str

        :param sender: Message sender (default: None)
        :type target: str

        :param ttl: Message time-to-live in seconds (default: None)
        :type ttl: int

        :param group: Message group name (default: None)
        :type group: str
        """
self
msg
Message to send
Message to send
key
Set it if you want to override the default devices
(default: None, message sent to all the configured devices)
Set it if you want to override the default devices ( default : None message sent to all the configured devices )
password
Set it if you want to override the default password (default: None)
Set it if you want to override the default password ( default : None )
devices
Set it if you want to send the message to a specific list of
configured devices (default: None, message sent to all the configured devices)
Set it if you want to send the message to a specific list of configured devices ( default : None message sent to all the configured devices )
target
Message target (default: None)
Message target ( default : None )
sender
Message sender (default: None)
Message sender ( default : None )
ttl
Message time-to-live in seconds (default: None)
Message time - to - live in seconds ( default : None )
group
Message group name (default: None)
Message group name ( default : None )