d16bc632da35a31957ba3ac399dab4769591af17,homeassistant/components/notify/pushsafer.py,PushsaferNotificationService,send_message,#PushsaferNotificationService#Any#,49

Before Change



        data["title"] = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)

        targets = kwargs.get(ATTR_TARGET)

        if not isinstance(targets, list):
            targets = [targets]

        for target in targets:
            if target is not None:
                data["device"] = target

            try:
                self.pushsafer.send_message(message, data["title"], "", "",
                                            "", "", "", "",
                                            "0", "", "", "")
            except ValueError as val_err:
                _LOGGER.error(str(val_err))

After Change


    def send_message(self, message="", **kwargs):
        Send a message to a user.
        title = kwargs.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)
        payload = {"k": self._private_key, "t": title, "m": message}
        response = requests.get(_RESOURCE, params=payload,
                                timeout=DEFAULT_TIMEOUT)
        if response.status_code != 200:
            _LOGGER.error("Not possible to send notification")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 9

Instances


Project Name: home-assistant/home-assistant
Commit Name: d16bc632da35a31957ba3ac399dab4769591af17
Time: 2017-03-07
Author: appzer@users.noreply.github.com
File Name: homeassistant/components/notify/pushsafer.py
Class Name: PushsaferNotificationService
Method Name: send_message


Project Name: cornellius-gp/gpytorch
Commit Name: 47a96974ab2d75fc20c76a6d6da20976ecad32bb
Time: 2017-10-02
Author: gpleiss@gmail.com
File Name: gpytorch/random_variables/random_variable.py
Class Name: RandomVariable
Method Name: cuda


Project Name: cornellius-gp/gpytorch
Commit Name: 47a96974ab2d75fc20c76a6d6da20976ecad32bb
Time: 2017-10-02
Author: gpleiss@gmail.com
File Name: gpytorch/random_variables/random_variable.py
Class Name: RandomVariable
Method Name: cpu


Project Name: home-assistant/home-assistant
Commit Name: d16bc632da35a31957ba3ac399dab4769591af17
Time: 2017-03-07
Author: appzer@users.noreply.github.com
File Name: homeassistant/components/notify/pushsafer.py
Class Name: PushsaferNotificationService
Method Name: send_message