platypush/plugins/esp/__init__.py
def spi_read(self, size: int, **kwargs) -> str:
        """
        Read from an SPI bus.

        :param size: Number of bytes to read.
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.spi_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.spi_open(**kwargs)
        code = 'spi.read({size})'.format(size=size)
        response = self.execute(code, **kwargs).output

        try:
            return response.decode()
        except UnicodeDecodeError:
            return base64.encodebytes(response).decode()

        Read from an SPI bus.

        :param size: Number of bytes to read.
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.spi_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 an SPI bus.
Read from an SPI bus .
def spi_read(self, size: int, **kwargs) -> str:
        self.spi_open(**kwargs)
        code = 'spi.read({size})'.format(size=size)
        response = self.execute(code, **kwargs).output
        try:
            return response.decode()
        except UnicodeDecodeError:
            return base64.encodebytes(response).decode()
def spi_read ( self , size : int , ** kwargs ) -> str : self . spi_open ( ** kwargs ) code = 'spi.read({size})' . format ( size = size ) response = self . execute ( code , ** kwargs ) . output try : return response . decode ( ) except UnicodeDecodeError : return base64 . encodebytes ( response ) . decode ( )
Read from an SPI bus.
Read from an SPI bus .
"""
        Read from an SPI bus.

        :param size: Number of bytes to read.
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.spi_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
int
Number of bytes to read.
Number of bytes to read .
kwargs
Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.spi_open` and
:meth:`platypush.plugins.esp.EspPlugin.execute`.
Parameters to pass to : meth : ` platypush . plugins . esp . EspPlugin . spi_open ` and : meth : ` platypush . plugins . esp . EspPlugin . execute ` .