当前位置: 首页>>代码示例>>Python>>正文


Python Pushbullet.get_device方法代码示例

本文整理汇总了Python中pushbullet.Pushbullet.get_device方法的典型用法代码示例。如果您正苦于以下问题:Python Pushbullet.get_device方法的具体用法?Python Pushbullet.get_device怎么用?Python Pushbullet.get_device使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pushbullet.Pushbullet的用法示例。


在下文中一共展示了Pushbullet.get_device方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: push

# 需要导入模块: from pushbullet import Pushbullet [as 别名]
# 或者: from pushbullet.Pushbullet import get_device [as 别名]
def push(text: str, details: str, r: praw) -> None:
    """
    Push a message to computer
    :param text: MNT or WNT
    :param details: Match details
    :param r: PRAW instance
    :return: None
    """
    try:
        from pushbullet import Pushbullet
        with open('token.txt') as files:
            token = files.read().strip()
        pb = Pushbullet(token)
        try:
            lst = text.split('?')
            pb.push_note('{} match today at {} on {}'.format(details, lst[4], lst[3]),
                         '', device=pb.get_device('iPhone'))
        except IndexError:
            pb.push_note('{}{}'.format(text, details),
                         '', device=pb.get_device('iPhone'))

    except ImportError:
        lst = text.split('?')
        r.send_message('RedRavens', '{} Match Today'.format(details),
                       '{} match today at {} on {}'.format(details, lst[4], lst[3]))
开发者ID:Red-Ravens,项目名称:soccer-updater,代码行数:27,代码来源:updater.py

示例2: loop

# 需要导入模块: from pushbullet import Pushbullet [as 别名]
# 或者: from pushbullet.Pushbullet import get_device [as 别名]
def loop():
    reduser = reddit_object.redditor("{redditor username}")
    for post in reduser.submissions.new(limit=1):
        if "ama" in post.title.lower() and post.id != last_ama_id:
            push_bullet = Pushbullet(pushbullet_access_token)
            my_phone = push_bullet.get_device("{device identifier}")
            my_phone.push_note("AMA Posted","User {redditor username} is doing an AMA!")
            exit()
    threading.Timer(10.0,loop).start()
开发者ID:kionay,项目名称:miscellaneous,代码行数:11,代码来源:amaupdate.py

示例3: send_pushbullet_message

# 需要导入模块: from pushbullet import Pushbullet [as 别名]
# 或者: from pushbullet.Pushbullet import get_device [as 别名]
def send_pushbullet_message(metro_time):
    from pushbullet import Pushbullet

    pb = Pushbullet(conn['pushbullet_api_key'])

    # If device name is provided, push to this device only
    to = pb.get_device(conn['pushbullet_device']) if conn['pushbullet_device'] else pb

    to.push_note("Time to go home!", "You have {0} minutes for the metro.".format(metro_time))
    print("Message pushed")
开发者ID:ligyxy,项目名称:Go-Home-Alert,代码行数:12,代码来源:main.py

示例4: push_file

# 需要导入模块: from pushbullet import Pushbullet [as 别名]
# 或者: from pushbullet.Pushbullet import get_device [as 别名]
def push_file(filename):
	if is_device_connected(DEVICE_MAC):
		print "Device is connected, not sending"
		return
	print "Sending", filename

	pushbullet = Pushbullet(PUSHBULLET_API_KEY)
	my_device = pushbullet.get_device(PUSHBULLET_DEVICE_NAME)
	file_data = pushbullet.upload_file(open(filename, "rb"), filename)
	pushbullet.push_file(device = my_device, **file_data)
	print "Sent!"
开发者ID:icode-co-il,项目名称:home-security,代码行数:13,代码来源:home_security.py

示例5: main

# 需要导入模块: from pushbullet import Pushbullet [as 别名]
# 或者: from pushbullet.Pushbullet import get_device [as 别名]
def main():
    with open("token.secret") as f:
        token = f.read().strip()
    print(token)

    pb = Pushbullet(token)
    # print(pb.push_note("this is title", "hoehoe"))
    for d in pb.devices:
        print(d.nickname)
        print(d.device_iden)

    myiphone = pb.get_device("yuk-iPhoneSE-g")
    print(myiphone)
    print(myiphone.push_note("title", "body"))

    return
开发者ID:10sr,项目名称:junks,代码行数:18,代码来源:a.py

示例6: Pushbullet

# 需要导入模块: from pushbullet import Pushbullet [as 别名]
# 或者: from pushbullet.Pushbullet import get_device [as 别名]
from pushbullet import Pushbullet
apiKey = 'o.jsMGG789aqsV47OChBCGlPIJjQGli3Qz'
apiKeyRob = "o.uKvCG8jgepkDdoQBoUFzVJ84zCgyQ0VU"

pb = Pushbullet(apiKey)
pbRob = Pushbullet(apiKeyRob)

xperia = pb.get_device('Xperia M2')
oneplus = pbRob.get_device('OnePlus One')

def sendNotificationToMattia(title,body):
    push = xperia.push_note(title, body)
       

def sendNotificationToRoberto(title,body):
    push = oneplus.push_note(title, body)

    




开发者ID:matti16,项目名称:PlaylistRecMicro,代码行数:18,代码来源:bullet.py

示例7: print

# 需要导入模块: from pushbullet import Pushbullet [as 别名]
# 或者: from pushbullet.Pushbullet import get_device [as 别名]
from watchdog.observers import Observer
from watchdog.observers.polling import PollingObserver   # Need to use this one if monitoring a mounted share from another computer, like the NAS

print(time.ctime() + " Starting")

SS_DIR    = '/mnt/surveillance'
PB_KEY    = 'YOUR_PRIVATE_PUSHBULLET_KEY'
PB_ID     = 'YOUR_PUSHBULLET_ID'
AR_KEY    = 'YOUR_PRIVATE_AUTOREMOTE_KEY'
#OG_FILE  = '/home/bruce/mh/local/data/logs/ss_monitor.vlog.txt'
LOG_FILE1 = '/home/bruce/mh/www/ss/ss_monitor.vlog.txt'
LOG_FILE2 = '/home/bruce/mh/www/ss/ss_monitor.slog.txt'
RESTART   = 6   # How many hours between restarts

pb        = Pushbullet(PB_KEY)
nuc       = pb.get_device(PB_ID)

def ar_to_cell (camera):
    r = requests.get("http://autoremotejoaomgcd.appspot.com/sendmessage?key=" + AR_KEY + "&message=motion=:=" + str(camera))
        
class Camera:
    list = {}
    def __init__(self, name):
        self.name = name
        self.file_v   = ''
        self.time_v   = 0
        self.keep     = 0
        self.notified = 0
        self.list[name] = self

def co_by_name(name):
开发者ID:brucewinter,项目名称:myhouse,代码行数:33,代码来源:ss_monitor.py


注:本文中的pushbullet.Pushbullet.get_device方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。