コード例 #1
0
ファイル: wirelesstag.py プロジェクト: sara0871/-.gitignore-
 def make_push_notitication(self, name, url, content):
     """Create notification config."""
     from wirelesstagpy import NotificationConfig
     return NotificationConfig(
         name, {
             'url': url,
             'verb': 'POST',
             'content': content,
             'disabled': False,
             'nat': True
         })
コード例 #2
0
ファイル: __init__.py プロジェクト: KapJI/home-assistant
    def make_notifications(self, binary_sensors, mac):
        """Create configurations for push notifications."""
        _LOGGER.info("Creating configurations for push notifications")
        configs = []

        bi_url = self.binary_event_callback_url
        for bi_sensor in binary_sensors:
            configs.extend(bi_sensor.event.build_notifications(bi_url, mac))

        update_url = self.update_callback_url

        update_config = NC.make_config_for_update_event(update_url, mac)

        configs.append(update_config)
        return configs
コード例 #3
0
    def make_notifications(self, binary_sensors, mac):
        """Create configurations for push notifications."""
        _LOGGER.info("Creating configurations for push notifications.")
        configs = []

        bi_url = self.binary_event_callback_url
        for bi_sensor in binary_sensors:
            configs.extend(bi_sensor.event.build_notifications(bi_url, mac))

        update_url = self.update_callback_url
        from wirelesstagpy import NotificationConfig as NC
        update_config = NC.make_config_for_update_event(update_url, mac)

        configs.append(update_config)
        return configs