FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update documentation structure and start migrating to markdown by sdb9696 · Pull Request #934 · python-kasa/python-kasa · GitHub

Repository navigation

2 changes: 1 addition & 1 deletion README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h2 align="center">python-kasa</h2>
# python-kasa
Comment thread
sdb9696 marked this conversation as resolved.

[![PyPI version](https://badge.fury.io/py/python-kasa.svg)](https://badge.fury.io/py/python-kasa)
[![Build Status](https://github.com/python-kasa/python-kasa/actions/workflows/ci.yml/badge.svg)](https://github.com/python-kasa/python-kasa/actions/workflows/ci.yml)
Expand Down
4 changes: 4 additions & 0 deletions docs/source/conf.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@
"myst_parser",
]

myst_enable_extensions = [
"colon_fence",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down
24 changes: 24 additions & 0 deletions docs/source/deprecated.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Deprecated API

```{currentmodule} kasa
```
The page contains the documentation for the deprecated library API that only works with the older kasa devices.

If you want to continue to use the old API for older devices,
you can use the classes in the `iot` module to avoid deprecation warnings.

```py
from kasa.iot import IotDevice, IotBulb, IotPlug, IotDimmer, IotStrip, IotLightStrip
```


```{toctree}
:maxdepth: 2

smartdevice
smartbulb
smartplug
smartdimmer
smartstrip
smartlightstrip
```
62 changes: 0 additions & 62 deletions docs/source/discover.rst

This file was deleted.

42 changes: 42 additions & 0 deletions docs/source/guides.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# How-to Guides

This page contains guides of how to perform common actions using the library.

## Discover devices

```{eval-rst}
.. automodule:: kasa.discover
```

## Connect without discovery

```{eval-rst}
.. automodule:: kasa.deviceconfig
```

## Get Energy Consumption and Usage Statistics

:::{note}
In order to use the helper methods to calculate the statistics correctly, your devices need to have correct time set.
The devices use NTP and public servers from [NTP Pool Project](https://www.ntppool.org/) to synchronize their time.
:::

### Energy Consumption

The availability of energy consumption sensors depend on the device.
While most of the bulbs support it, only specific switches (e.g., HS110) or strips (e.g., HS300) support it.
You can use {attr}`~Device.has_emeter` to check for the availability.


### Usage statistics

You can use {attr}`~Device.on_since` to query for the time the device has been turned on.
Some devices also support reporting the usage statistics on daily or monthly basis.
You can access this information using through the usage module ({class}`kasa.modules.Usage`):

```py
dev = SmartPlug("127.0.0.1")
usage = dev.modules["usage"]
print(f"Minutes on this month: {usage.usage_this_month}")
print(f"Minutes on today: {usage.usage_today}")
```
12 changes: 12 additions & 0 deletions docs/source/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
```{include} ../../README.md
```

```{toctree}
:maxdepth: 2

Home <self>
cli
Comment thread
sdb9696 marked this conversation as resolved.
library
contribute
SUPPORTED
```
20 changes: 0 additions & 20 deletions docs/source/index.rst

This file was deleted.

15 changes: 15 additions & 0 deletions docs/source/library.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Library usage

```{currentmodule} kasa
```
The page contains all information about the library usage:

```{toctree}
:maxdepth: 2

tutorial
guides
topics
reference
deprecated
```
134 changes: 134 additions & 0 deletions docs/source/reference.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
# API Reference

Comment thread
sdb9696 marked this conversation as resolved.
```{currentmodule} kasa
```

## Discover

```{eval-rst}
.. autoclass:: kasa.Discover
:members:
```

## Device

```{eval-rst}
.. autoclass:: kasa.Device
:members:
:undoc-members:
```

## Modules and Features

```{eval-rst}
.. autoclass:: kasa.Module
:noindex:
:members:
:inherited-members:
:undoc-members:
```

```{eval-rst}
.. automodule:: kasa.interfaces
:noindex:
:members:
:inherited-members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.Feature
:noindex:
:members:
:inherited-members:
:undoc-members:
```

## Protocols and transports

```{eval-rst}
.. autoclass:: kasa.protocol.BaseProtocol
:members:
:inherited-members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.iotprotocol.IotProtocol
:members:
:inherited-members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.smartprotocol.SmartProtocol
:members:
:inherited-members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.protocol.BaseTransport
:members:
:inherited-members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.xortransport.XorTransport
:members:
:inherited-members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.klaptransport.KlapTransport
:members:
:inherited-members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.klaptransport.KlapTransportV2
:members:
:inherited-members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.aestransport.AesTransport
:members:
:inherited-members:
:undoc-members:
```

## Errors and exceptions

```{eval-rst}
.. autoclass:: kasa.exceptions.KasaException
:members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.exceptions.DeviceError
:members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.exceptions.AuthenticationError
:members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.exceptions.UnsupportedDeviceError
:members:
:undoc-members:
```

```{eval-rst}
.. autoclass:: kasa.exceptions.TimeoutError
:members:
:undoc-members:
Loading

Back | FazBrowse Home | New Git URL