platypush/plugins/esp/__init__.py
def uart_read(self, size: Optional[int] = None, **kwargs) -> str:
        """
        Read from a UART interface.

        :param size: Number of bytes to read (default: read all available characters).
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.uart_open` and
            :meth:`platypush.plugins.esp.EspPlugin.execute`.
        :return: String representation of the read bytes, or base64-encoded representation if the
            data can't be decoded to a string.
        """
        self.uart_open(**kwargs)

        code = '''
args = []
if {size}:
    args.append({size})

uart.read(*args)
'''.format(size=size)

        response = self.execute(code, **kwargs).output
        try:
            return response.decode()
        except UnicodeDecodeError:
            return base64.encodebytes(response).decode()

        Read from a UART interface.

        :param size: Number of bytes to read (default: read all available characters).
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.uart_open` and
            :meth:`platypush.plugins.esp.EspPlugin.execute`.
        :return: String representation of the read bytes, or base64-encoded representation if the
            data can't be decoded to a string.
        
Read from a UART interface.
Read from a UART interface .
def uart_read(self, size: Optional[int] = None, **kwargs) -> str:
        self.uart_open(**kwargs)
        code = '''
args = []
if {size}:
    args.append({size})
uart.read(*args)
'''.format(size=size)
        response = self.execute(code, **kwargs).output
        try:
            return response.decode()
        except UnicodeDecodeError:
            return base64.encodebytes(response).decode()
def uart_read ( self , size : Optional [ int ] = None , ** kwargs ) -> str : self . uart_open ( ** kwargs ) code = '''
args = []
if {size}:
    args.append({size})

uart.read(*args)
''' . format ( size = size ) response = self . execute ( code , ** kwargs ) . output try : return response . decode ( ) except UnicodeDecodeError : return base64 . encodebytes ( response ) . decode ( )
Read from a UART interface.
Read from a UART interface .
"""
        Read from a UART interface.

        :param size: Number of bytes to read (default: read all available characters).
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.uart_open` and
            :meth:`platypush.plugins.esp.EspPlugin.execute`.
        :return: String representation of the read bytes, or base64-encoded representation if the
            data can't be decoded to a string.
        """
String representation of the read bytes, or base64-encoded representation if the
data can't be decoded to a string.
String representation of the read bytes or base64 - encoded representation if the data can ' t be decoded to a string .
self
size
Optional[int]
Number of bytes to read (default: read all available characters).
Number of bytes to read ( default : read all available characters ) .
kwargs
Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.uart_open` and
:meth:`platypush.plugins.esp.EspPlugin.execute`.
Parameters to pass to : meth : ` platypush . plugins . esp . EspPlugin . uart_open ` and : meth : ` platypush . plugins . esp . EspPlugin . execute ` .