platypush/plugins/esp/__init__.py
def pin_read(self, pin: Union[int, str], out: bool = False, pull_up: bool = False, **kwargs) -> bool:
        """
        Get the ON/OFF value of a PIN.

        :param pin: GPIO PIN number or configured name.
        :param out: Treat the PIN as an output PIN - e.g. if you usually write to it and now want to read the
            value. If not set, then the PIN will be treated as an input PIN.
        :param pull_up: Set to True if the PIN has a (weak) pull-up resistor attached.
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        """
        device = self._get_device(**kwargs)
        pin = device.get_pin(pin)
        code = '''
import machine
pin = machine.Pin({pin}, machine.Pin.{inout}{pull_up})
pin.value()
'''.format(pin=pin, inout='OUT' if out else 'IN', pull_up=', machine.Pin.PULL_UP' if pull_up else '')

        return bool(self.execute(code, **kwargs).output)

        Get the ON/OFF value of a PIN.

        :param pin: GPIO PIN number or configured name.
        :param out: Treat the PIN as an output PIN - e.g. if you usually write to it and now want to read the
            value. If not set, then the PIN will be treated as an input PIN.
        :param pull_up: Set to True if the PIN has a (weak) pull-up resistor attached.
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        
Get the ON/OFF value of a PIN.
Get the ON / OFF value of a PIN .
def pin_read(self, pin: Union[int, str], out: bool = False, pull_up: bool = False, **kwargs) -> bool:
        device = self._get_device(**kwargs)
        pin = device.get_pin(pin)
        code = '''
import machine
pin = machine.Pin({pin}, machine.Pin.{inout}{pull_up})
pin.value()
'''.format(pin=pin, inout='OUT' if out else 'IN', pull_up=', machine.Pin.PULL_UP' if pull_up else '')
        return bool(self.execute(code, **kwargs).output)
def pin_read ( self , pin : Union [ int , str ] , out : bool = False , pull_up : bool = False , ** kwargs ) -> bool : device = self . _get_device ( ** kwargs ) pin = device . get_pin ( pin ) code = '''
import machine
pin = machine.Pin({pin}, machine.Pin.{inout}{pull_up})
pin.value()
''' . format ( pin = pin , inout = 'OUT' if out else 'IN' , pull_up = ', machine.Pin.PULL_UP' if pull_up else '' ) return bool ( self . execute ( code , ** kwargs ) . output )
Get the ON/OFF value of a PIN.
Get the ON / OFF value of a PIN .
"""
        Get the ON/OFF value of a PIN.

        :param pin: GPIO PIN number or configured name.
        :param out: Treat the PIN as an output PIN - e.g. if you usually write to it and now want to read the
            value. If not set, then the PIN will be treated as an input PIN.
        :param pull_up: Set to True if the PIN has a (weak) pull-up resistor attached.
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        """
self
pin
Union[int, str]
GPIO PIN number or configured name.
GPIO PIN number or configured name .
out
bool
Treat the PIN as an output PIN - e.g. if you usually write to it and now want to read the
value. If not set, then the PIN will be treated as an input PIN.
Treat the PIN as an output PIN - e . g . if you usually write to it and now want to read the value . If not set then the PIN will be treated as an input PIN .
pull_up
bool
Set to True if the PIN has a (weak) pull-up resistor attached.
Set to True if the PIN has a ( weak ) pull - up resistor attached .
kwargs
Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
Parameters to pass to : meth : ` platypush . plugins . esp . EspPlugin . execute ` .