Ejemplo n.º 1
0
def lights_connection( arguments ):
    global __arduino

    zone = arguments[ 'zone' ]
    off = CmdManager.firestones_zones[ 'connections' ][ zone ]
    for zn in off:
        pos = CmdManager.firestones_zones[ 'groups' ][ zn ]
        CmdManager.firestones[ pos - 1 ] = False    
    
    pos = CmdManager.firestones_zones[ 'groups' ][ zone ]
    CmdManager.firestones[ pos - 1 ] = True


    if __arduino:
        ArdnLib.send_line( CmdManager.firestones )
    else:
        print 'lights_connection (', arguments, ')'
        print CmdManager.firestones
Ejemplo n.º 2
0
def lights_off( arguments ):
    global __arduino

    zone, zones = arguments[ 'zone' ], [ ]
    for zn in CmdManager.firestones_zones[ 'groups' ]:
        if zn == zone:
            zones.append( zn )
        elif len( zn ) > 1 and zn[ 0 ] == zone:
            zones.append( zn )

    for zn in zones:
        pos = CmdManager.firestones_zones[ 'groups' ][ zn ]
        CmdManager.firestones[ pos - 1 ] = False
    
    if __arduino:
        ArdnLib.send_line( CmdManager.firestones )
    else:
        print 'lights_off (', arguments, ')'
        print CmdManager.firestones