:mod:`supervisor` ================= .. py:module:: supervisor .. autoapi-nested-parse:: Supervisor settings .. data:: runtime :annotation: :Runtime Runtime information, such as ``runtime.serial_connected`` (USB serial connection status). This object is the sole instance of `supervisor.Runtime`. .. function:: enable_autoreload() -> None Enable autoreload based on USB file write activity. .. function:: disable_autoreload() -> None Disable autoreload based on USB file write activity until `enable_autoreload` is called. .. function:: set_rgb_status_brightness(brightness: int) -> None Set brightness of status neopixel from 0-255 `set_rgb_status_brightness` is called. .. function:: reload() -> None Reload the main Python code and run it (equivalent to hitting Ctrl-D at the REPL). .. function:: set_next_stack_limit(size: int) -> None Set the size of the stack for the next vm run. If its too large, the default will be used. .. py:class:: Runtime Current status of runtime objects. Usage:: import supervisor if supervisor.runtime.serial_connected: print("Hello World!") You cannot create an instance of `supervisor.Runtime`. Use `supervisor.runtime` to access the sole instance available. .. attribute:: serial_connected :annotation: :bool Returns the USB serial communication status (read-only). .. note:: SAMD: Will return ``True`` if the USB serial connection has been established at any point. Will not reset if USB is disconnected but power remains (e.g. battery connected) .. attribute:: serial_bytes_available :annotation: :int Returns the whether any bytes are available to read on the USB serial input. Allows for polling to see whether to call the built-in input() or wait. (read-only)