platypush/plugins/esp/__init__.py
def execute(self,
                code: str,
                device: Optional[str] = None,
                host: Optional[str] = None,
                port: int = 8266,
                password: Optional[str] = None,
                conn_timeout: Optional[float] = 10.0,
                recv_timeout: Optional[float] = 30.0,
                wait_response: bool = True,
                **kwargs) -> Response:
        """
        Run raw Python code on the ESP device.

        :param code: Snippet of code to run.
        :param device: Configured device name. Either ``device`` or ``host`` and ``port`` must be provided.
        :param host: ESP host.
        :param port: ESP port (default: 8266).
        :param password: ESP WebREPL password.
        :param conn_timeout: Connection timeout (default: 10 seconds).
        :param recv_timeout: Response receive timeout (default: 30 seconds).
        :param wait_response: Wait for the response from the device (default: True)
        :return: The response returned by the Micropython interpreter, as a string.
        """
        device = self._get_device(device=device, host=host, port=port, password=password)
        self.connect(host=device['host'], port=device['port'], password=device['password'], timeout=conn_timeout)
        conn = self._connections.get((device['host'], device['port']))

        try:
            return conn.send(code, timeout=recv_timeout, wait_response=wait_response)
        except Exception as e:
            conn.close()
            raise e

        Run raw Python code on the ESP device.

        :param code: Snippet of code to run.
        :param device: Configured device name. Either ``device`` or ``host`` and ``port`` must be provided.
        :param host: ESP host.
        :param port: ESP port (default: 8266).
        :param password: ESP WebREPL password.
        :param conn_timeout: Connection timeout (default: 10 seconds).
        :param recv_timeout: Response receive timeout (default: 30 seconds).
        :param wait_response: Wait for the response from the device (default: True)
        :return: The response returned by the Micropython interpreter, as a string.
        
Run raw Python code on the ESP device.
Run raw Python code on the ESP device .
def execute(self,
                code: str,
                device: Optional[str] = None,
                host: Optional[str] = None,
                port: int = 8266,
                password: Optional[str] = None,
                conn_timeout: Optional[float] = 10.0,
                recv_timeout: Optional[float] = 30.0,
                wait_response: bool = True,
                **kwargs) -> Response:
        device = self._get_device(device=device, host=host, port=port, password=password)
        self.connect(host=device['host'], port=device['port'], password=device['password'], timeout=conn_timeout)
        conn = self._connections.get((device['host'], device['port']))
        try:
            return conn.send(code, timeout=recv_timeout, wait_response=wait_response)
        except Exception as e:
            conn.close()
            raise e
def execute ( self , code : str , device : Optional [ str ] = None , host : Optional [ str ] = None , port : int = 8266 , password : Optional [ str ] = None , conn_timeout : Optional [ float ] = 10.0 , recv_timeout : Optional [ float ] = 30.0 , wait_response : bool = True , ** kwargs ) -> Response : device = self . _get_device ( device = device , host = host , port = port , password = password ) self . connect ( host = device [ 'host' ] , port = device [ 'port' ] , password = device [ 'password' ] , timeout = conn_timeout ) conn = self . _connections . get ( ( device [ 'host' ] , device [ 'port' ] ) ) try : return conn . send ( code , timeout = recv_timeout , wait_response = wait_response ) except Exception as e : conn . close ( ) raise e
Run raw Python code on the ESP device.
Run raw Python code on the ESP device .
"""
        Run raw Python code on the ESP device.

        :param code: Snippet of code to run.
        :param device: Configured device name. Either ``device`` or ``host`` and ``port`` must be provided.
        :param host: ESP host.
        :param port: ESP port (default: 8266).
        :param password: ESP WebREPL password.
        :param conn_timeout: Connection timeout (default: 10 seconds).
        :param recv_timeout: Response receive timeout (default: 30 seconds).
        :param wait_response: Wait for the response from the device (default: True)
        :return: The response returned by the Micropython interpreter, as a string.
        """
The response returned by the Micropython interpreter, as a string.
The response returned by the Micropython interpreter as a string .
self
code
str
Snippet of code to run.
Snippet of code to run .
device
Optional[str]
Configured device name. Either ``device`` or ``host`` and ``port`` must be provided.
Configured device name . Either ` ` device ` ` or ` ` host ` ` and ` ` port ` ` must be provided .
host
Optional[str]
None
port
int
None
password
Optional[str]
ESP WebREPL password.
ESP WebREPL password .
conn_timeout
Optional[float]
Connection timeout (default: 10 seconds).
Connection timeout ( default : 10 seconds ) .
recv_timeout
Optional[float]
Response receive timeout (default: 30 seconds).
Response receive timeout ( default : 30 seconds ) .
wait_response
bool
Wait for the response from the device (default: True)
Wait for the response from the device ( default : True )