Files
python-kasa/docs/source/reference.md
Teemu R. a68f2b3304
Some checks failed
CI / Perform Lint Checks (3.15) (push) Has been cancelled
CodeQL Checks / Analyze (python) (push) Has been cancelled
CI / Python 3.11 on macos-latest (push) Has been cancelled
CI / Python 3.12 on macos-latest (push) Has been cancelled
CI / Python 3.13 on macos-latest (push) Has been cancelled
CI / Python 3.14 on macos-latest (push) Has been cancelled
CI / Python 3.15 on macos-latest (push) Has been cancelled
CI / Python 3.11 on ubuntu-latest (push) Has been cancelled
CI / Python 3.12 on ubuntu-latest (push) Has been cancelled
CI / Python 3.13 on ubuntu-latest (push) Has been cancelled
CI / Python 3.14 on ubuntu-latest (push) Has been cancelled
CI / Python 3.15 on ubuntu-latest (push) Has been cancelled
CI / Python 3.11 on windows-latest (push) Has been cancelled
CI / Python 3.12 on windows-latest (push) Has been cancelled
CI / Python 3.13 on windows-latest (push) Has been cancelled
CI / Python 3.14 on windows-latest (push) Has been cancelled
CI / Python 3.15 on windows-latest (push) Has been cancelled
Stale / stale (push) Has been cancelled
Detect offline hub children and fail fast on writes to them (#1830)
Hubs keep reporting for children they have lost contact with, so callers
see stale values as if they were live. Trying to write to such devices
fail after timeouts with a generic error.
This PR exposes the offline/online information as reported by the hub,
and refuses writes to unreachable child devices without waiting for
device errors.

In details:
- Add new API: `Device.is_available`; hub children report unavailable
when the hub marks them offline or no longer lists them.
- New feature `available` for child devices to make it visible to the
CLI.
- Refuse writes to unavailable children with the new
`DeviceUnavailableError` instead of waiting for the hub to time out.
2026-11-01 18:18:03 +01:00

1.9 KiB

API Reference

Discover

.. autoclass:: Discover
    :members:

Device

% N.B. Credentials clashes with autodoc

.. autoclass:: Device
    :members:
    :undoc-members:
    :exclude-members: Credentials

Device Config

.. autoclass:: Credentials
    :members:
    :undoc-members:
.. autoclass:: DeviceConfig
    :members:
    :undoc-members:
.. autoclass:: DeviceFamily
    :members:
    :undoc-members:
.. autoclass:: DeviceConnectionParameters
    :members:
    :undoc-members:
.. autoclass:: DeviceEncryptionType
    :members:
    :undoc-members:

Modules and Features

.. autoclass:: Module
    :members:
.. autoclass:: Feature
    :members:
    :inherited-members:
    :undoc-members:
.. automodule:: kasa.interfaces
    :members:
    :inherited-members:
    :undoc-members:

Protocols and transports

.. automodule:: kasa.protocols
    :members:
    :imported-members:
    :undoc-members:
    :exclude-members: SmartErrorCode
    :no-index:
.. automodule:: kasa.transports
    :members:
    :imported-members:
    :undoc-members:
    :no-index:

Errors and exceptions

.. autoclass:: kasa.exceptions.KasaException
    :members:
    :undoc-members:
.. autoclass:: kasa.exceptions.DeviceError
    :members:
    :undoc-members:
.. autoclass:: kasa.exceptions.AuthenticationError
    :members:
    :undoc-members:
.. autoclass:: kasa.exceptions.DeviceUnavailableError
    :members:
    :undoc-members:
.. autoclass:: kasa.exceptions.UnsupportedDeviceError
    :members:
    :undoc-members:
.. autoclass:: kasa.exceptions.TimeoutError
    :members:
    :undoc-members: