(sat, setup)
return lnb
Configure LNB - either from preset or from custom specs

    Configure also the LNB power supply, if applicable.

    Args:
        sat   : user's satellite info
        setup : user's setup info
Configure LNB - either from preset or from custom specs
Configure LNB - either from preset or from custom specs
def _cfg_lnb(sat, setup):
    """Configure LNB - either from preset or from custom specs

    Configure also the LNB power supply, if applicable.

    Args:
        sat   : user's satellite info
        setup : user's setup info

    """

    # For flat-panel and Sat-IP antennas, the LNB is the integrated one
    if (setup['antenna']['type'] in ['flat', 'sat-ip']):
        for lnb in defs.lnbs:
            if lnb['vendor'] == 'Selfsat':
                lnb["v1_pointed"] = False
                return lnb

    os.system('clear')
    util.print_header("LNB")

    lnb = _ask_lnb(sat)

    if (not _sat_freq_in_lnb_range(sat, lnb)):
        logging.warning("Your LNB's input frequency range does not cover the "
                        "frequency of {} ({} MHz)".format(
                            sat['name'], sat['dl_freq']))
        if not util.ask_yes_or_no("Continue anyway?", default="n"):
            logging.error("Invalid LNB")
            sys.exit(1)

    if (sat['band'].lower() != lnb['band'].lower()):
        logging.error("The LNB you chose cannot operate " +
                      "in %s band (band of satellite %s)" %
                      (sat['band'], sat['alias']))
        sys.exit(1)

    # When configuring a non-SDR receiver with a dual polarization LNB, we must
    # know whether the LNB was pointed before on an SDR setup in order to
    # define the polarization on channels.conf. When configuring an SDR
    # receiver, collect the power inserter voltage too for future use.
    if ((lnb['pol'].lower() == "dual" and setup['type'] != defs.sdr_setup_type)
            or setup['type'] == defs.sdr_setup_type):
        os.system('clear')
        util.print_header("Power Supply")

    if (lnb['pol'].lower() == "dual" and setup['type'] != defs.sdr_setup_type):
        prev_sdr_setup = util.ask_yes_or_no(
            "Are you reusing an LNB that is already pointed and that was used "
            "before by an SDR receiver?",
            default='n',
            help_msg="NOTE: this information is helpful to determine the "
            "polarization required for the LNB.")

        lnb["v1_pointed"] = prev_sdr_setup

        if (prev_sdr_setup):
            print()
            question = (
                "In the pre-existing SDR setup, did you use one of the "
                "LNB power inserters below?")
            lnb["v1_psu_voltage"] = _ask_psu_voltage(question)
    elif (setup['type'] == defs.sdr_setup_type):
        question = ("Are you using one of the LNB power inserters below?")
        lnb["psu_voltage"] = _ask_psu_voltage(question)

    return lnb
def _cfg_lnb ( sat , setup ) : # For flat-panel and Sat-IP antennas, the LNB is the integrated one if ( setup [ 'antenna' ] [ 'type' ] in [ 'flat' , 'sat-ip' ] ) : for lnb in defs . lnbs : if lnb [ 'vendor' ] == 'Selfsat' : lnb [ "v1_pointed" ] = False return lnb os . system ( 'clear' ) util . print_header ( "LNB" ) lnb = _ask_lnb ( sat ) if ( not _sat_freq_in_lnb_range ( sat , lnb ) ) : logging . warning ( "Your LNB's input frequency range does not cover the " "frequency of {} ({} MHz)" . format ( sat [ 'name' ] , sat [ 'dl_freq' ] ) ) if not util . ask_yes_or_no ( "Continue anyway?" , default = "n" ) : logging . error ( "Invalid LNB" ) sys . exit ( 1 ) if ( sat [ 'band' ] . lower ( ) != lnb [ 'band' ] . lower ( ) ) : logging . error ( "The LNB you chose cannot operate " + "in %s band (band of satellite %s)" % ( sat [ 'band' ] , sat [ 'alias' ] ) ) sys . exit ( 1 ) # When configuring a non-SDR receiver with a dual polarization LNB, we must # know whether the LNB was pointed before on an SDR setup in order to # define the polarization on channels.conf. When configuring an SDR # receiver, collect the power inserter voltage too for future use. if ( ( lnb [ 'pol' ] . lower ( ) == "dual" and setup [ 'type' ] != defs . sdr_setup_type ) or setup [ 'type' ] == defs . sdr_setup_type ) : os . system ( 'clear' ) util . print_header ( "Power Supply" ) if ( lnb [ 'pol' ] . lower ( ) == "dual" and setup [ 'type' ] != defs . sdr_setup_type ) : prev_sdr_setup = util . ask_yes_or_no ( "Are you reusing an LNB that is already pointed and that was used " "before by an SDR receiver?" , default = 'n' , help_msg = "NOTE: this information is helpful to determine the " "polarization required for the LNB." ) lnb [ "v1_pointed" ] = prev_sdr_setup if ( prev_sdr_setup ) : print ( ) question = ( "In the pre-existing SDR setup, did you use one of the " "LNB power inserters below?" ) lnb [ "v1_psu_voltage" ] = _ask_psu_voltage ( question ) elif ( setup [ 'type' ] == defs . sdr_setup_type ) : question = ( "Are you using one of the LNB power inserters below?" ) lnb [ "psu_voltage" ] = _ask_psu_voltage ( question ) return lnb