Skip to content

[Question]: Set GPIO.mode Via RFDevice Constructor #70

Description

@hasenradball

@milaq Hi,

I would like to enhance the constructor in that way, that I can define during construction if the mode BCM or BOARD is used.
Is this possible?

Kind of like this
see PR: #71

def __init__(self, pin, mode, tx_proto=1, tx_pulselength=None, tx_repeat=10, tx_length=24, rx_tolerance=80):

self.pin = pin

if (mode.upper() == 'BCM'):
      GPIO.setmode(GPIO.BCM)
      _LOGGER.debug("Using GPIO Pin " + str(pin))
elif (mode.upper() == 'BOARD'):
    GPIO.setmode(GPIO.BOARD)
      _LOGGER.debug("Using Board Pin " + str(pin))
....

Regards Frank

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions