docs: modernize docstrings across the repository (#1682)

Comprehensive docstring cleanup across the repository — fix Sphinx
cross-references, Python REPL continuation syntax, stale class names,
and modernize the IotBulb docstring to use the
`Module.Light`/`Module.LightPreset` interface.
This commit is contained in:
ZeliardM
2026-07-05 12:30:01 -04:00
committed by GitHub
parent 7f10a39655
commit bb27a43027
18 changed files with 136 additions and 120 deletions

View File

@@ -6,10 +6,10 @@ Light, AutoOff, Firmware etc.
>>> from kasa import Discover, Module
>>>
>>> dev = await Discover.discover_single(
>>> "127.0.0.3",
>>> username="user@example.com",
>>> password="great_password"
>>> )
... "127.0.0.3",
... username="user@example.com",
... password="great_password"
... )
>>> await dev.update()
>>> print(dev.alias)
Living Room Bulb
@@ -18,7 +18,7 @@ To see whether a device supports a group of functionality
check for the existence of the module:
>>> if light := dev.modules.get("Light"):
>>> print(light.brightness)
... print(light.brightness)
100
.. include:: ../featureattributes.md
@@ -28,7 +28,7 @@ To see whether a device supports specific functionality, you can check whether t
module has that feature:
>>> if light.has_feature("hsv"):
>>> print(light.hsv)
... print(light.hsv)
HSV(hue=0, saturation=100, value=100)
If you know or expect the module to exist you can access by index:
@@ -44,8 +44,8 @@ Modules support typing via the Module names in Module:
>>> light_effect = dev.modules.get("LightEffect")
>>> light_effect_typed = dev.modules.get(Module.LightEffect)
>>> if TYPE_CHECKING:
>>> reveal_type(light_effect) # Static checker will reveal: str
>>> reveal_type(light_effect_typed) # Static checker will reveal: LightEffect
... reveal_type(light_effect) # Static checker will reveal: str
... reveal_type(light_effect_typed) # Static checker will reveal: LightEffect
"""