diff --git a/docs/source/api.rst b/docs/source/api.rst index 21a5f94..f2f347e 100644 --- a/docs/source/api.rst +++ b/docs/source/api.rst @@ -6,6 +6,7 @@ Main Classes .. autoclass:: bluos.BluOSDevice :members: + :special-members: __init__ Data Classes ------------ diff --git a/docs/source/index.rst b/docs/source/index.rst index 4f2a189..bde6820 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,7 +1,20 @@ BluOS Client ============ -This is a Python library for interfacing with BlueOS device. +This is a Python library for interfacing with BlueOS device. It uses the +`BlueOS API `_ +to control and query the status of BlueOS devices. + +A basic example of usage: + +.. code-block:: python + + from blueos import BluOSDevice + + async def main(): + async with BluOSDevice("") as device: + status = await device.status() + print(status) .. toctree:: :maxdepth: 2 diff --git a/src/bluos/_device.py b/src/bluos/_device.py index 41debee..855b6fa 100644 --- a/src/bluos/_device.py +++ b/src/bluos/_device.py @@ -23,7 +23,7 @@ class BluOSDevice: def __init__(self, host: str, port: int = 11000, session: aiohttp.ClientSession = None): """Represents a BluOS device. - The passed sessions will not be closed when the device is closed. + The passed sessions will not be closed when the device is closed and has to be closed by the caller. :param host: The hostname or IP address of the device. :param port: The port of the device. Default is 11000.