Ejemplo n.º 1
0
def notify_velib(conf):
    """
    Envoi un CR de disponibilite des Velibs a proximite 
    """
    loc = conf["location"]
    velib = Velib()
    message = ""
    for station, nbVelib in velib.dispo(loc).items():
        message += "Station %s : %d velos\n" % (station, nbVelib)
    pb = PushBullet(conf["pushbullet"]["api"])
    phone = pb.devices[0]
    phone.push_note("Dispos Velibs", message)
Ejemplo n.º 2
0
def notify_velib():
    """
    Envoi un CR de disponibilite des Velibs a proximite 
    """
    location = conf["location"]
    rayon = int(conf["rayon"])

    velib = Velib()
    message = ""
    for station, nbVelib in velib.dispo(location,rayon).items():
        message += "Station %s : %d velos dispos\n" % (station, nbVelib)

    logger.debug("*Debut* notification pushbullet")
    pb = PushBullet(conf["pushbullet"]["api"])
    phone = pb.devices[0]
    phone.push_note("Dispos Velibs", message)
    logger.debug("*Fin* notification pushbullet")