Ejemplo n.º 1
0
def __getSingleZone(name_udn):
    """Tries to find the first occurring Zone with the specified name or UDN"""
    zone = None
    if (name_udn.startswith("uuid:")):
        zone = raumfeld.getZoneByUDN(name_udn)
    else:
        zones = raumfeld.getZonesByName(name_udn.decode('utf-8'))
        if (len(zones) > 0):
            zone = zones[0]
    return zone
Ejemplo n.º 2
0
def __getSingleZone(name_udn):
    """Tries to find the first occurring Zone with the specified name or UDN"""
    zone = None
    if (name_udn.startswith("uuid:")):
        zone = raumfeld.getZoneByUDN(name_udn)
    else:
        zones = raumfeld.getZonesByName(name_udn.decode('utf-8'))
        if (len(zones) > 0):
            zone = zones[0]
    return zone
Ejemplo n.º 3
0
def zone_name(name):
        """Partial, unique string contained in the name or whole name of the zone is used to set the active zone"""
        global active_zone_udn
        zones = raumfeld.getZonesByName(name)
        zone = zones[0]
        active_zone_udn = zone.UDN
        with open('active_zone_udn', 'w') as f:
            f.write(active_zone_udn)
        sleep(ctct_sleep)
        redirect('/ctct')