(info)
return options[0]
Find suitable LNB within v4l-utils preset LNBs

    The LNBs on list v4l_lnbs are defined at lib/libdvbv5/dvb-sat.c
Find suitable LNB within v4l-utils preset LNBs
Find suitable LNB within v4l - utils preset LNBs
def _find_v4l_lnb(info):
    """Find suitable LNB within v4l-utils preset LNBs

    The LNBs on list v4l_lnbs are defined at lib/libdvbv5/dvb-sat.c

    """

    target_lo_freq_raw = info['lnb']['lo_freq']
    target_is_universal = info['lnb']['universal']

    if (target_is_universal):
        assert (isinstance(target_lo_freq_raw, list))
        assert (len(target_lo_freq_raw) == 2)
        target_lo_freq = [int(x) for x in target_lo_freq_raw]
    else:
        target_lo_freq = [int(target_lo_freq_raw)]

    # Find options that match the LO freq
    options = list()
    for lnb in defs.v4l_lnbs:
        is_universal_option = 'highfreq' in lnb

        if (target_is_universal and (not is_universal_option)):
            continue

        if (info['lnb']['pol'].lower() == "dual" and  # user has dual-pol LNB
            (
                info['sat']['pol'] == "H" or  # and satellite requires H pol
                (
                    'v1_pointed' in info['lnb'] and info['lnb']['v1_pointed']
                    and info['lnb']['v1_psu_voltage'] >=
                    16  # or LNB already operates with H pol
                )) and "rangeswitch"
                not in lnb):  # but LNB candidate is single-pol
            continue  # not a validate candidate, skip

        if (target_is_universal):
            if (is_universal_option and lnb['lowfreq'] == target_lo_freq[0]
                    and lnb['highfreq'] == target_lo_freq[1]):
                options.append(lnb)
        else:
            if (lnb['lowfreq'] == target_lo_freq[0]):
                options.append(lnb)

    assert (len(options) > 0), "LNB doesn't match a valid option"
    logger.debug("Matching LNB options: {}".format(pformat(options)))

    return options[0]
def _find_v4l_lnb ( info ) : target_lo_freq_raw = info [ 'lnb' ] [ 'lo_freq' ] target_is_universal = info [ 'lnb' ] [ 'universal' ] if ( target_is_universal ) : assert ( isinstance ( target_lo_freq_raw , list ) ) assert ( len ( target_lo_freq_raw ) == 2 ) target_lo_freq = [ int ( x ) for x in target_lo_freq_raw ] else : target_lo_freq = [ int ( target_lo_freq_raw ) ] # Find options that match the LO freq options = list ( ) for lnb in defs . v4l_lnbs : is_universal_option = 'highfreq' in lnb if ( target_is_universal and ( not is_universal_option ) ) : continue if ( info [ 'lnb' ] [ 'pol' ] . lower ( ) == "dual" and # user has dual-pol LNB ( info [ 'sat' ] [ 'pol' ] == "H" or # and satellite requires H pol ( 'v1_pointed' in info [ 'lnb' ] and info [ 'lnb' ] [ 'v1_pointed' ] and info [ 'lnb' ] [ 'v1_psu_voltage' ] >= 16 # or LNB already operates with H pol ) ) and "rangeswitch" not in lnb ) : # but LNB candidate is single-pol continue # not a validate candidate, skip if ( target_is_universal ) : if ( is_universal_option and lnb [ 'lowfreq' ] == target_lo_freq [ 0 ] and lnb [ 'highfreq' ] == target_lo_freq [ 1 ] ) : options . append ( lnb ) else : if ( lnb [ 'lowfreq' ] == target_lo_freq [ 0 ] ) : options . append ( lnb ) assert ( len ( options ) > 0 ) , "LNB doesn't match a valid option" logger . debug ( "Matching LNB options: {}" . format ( pformat ( options ) ) ) return options [ 0 ]