-
-
Notifications
You must be signed in to change notification settings - Fork 238
Update documentation structure and start migrating to markdown #934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4094532
Update documentation structure and start migrating to markdown
sdb9696 947c0be
Fix readme discovery tests not working and address post review
sdb9696 cb29935
Merge remote-tracking branch 'upstream/master' into janitor/module_docs
sdb9696 0c4f497
Remove debug flag from cli docs
sdb9696 e58e8ec
Update test framework to support better code example testing and fix …
sdb9696 2cc322e
Update post review
sdb9696 77313a0
Update test_discover_single with comments and remove comment parameters
sdb9696 e758b64
Merge remote-tracking branch 'upstream/master' into janitor/module_docs
sdb9696 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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 | ||
| ``` |
This file was deleted.
Oops, something went wrong.
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}") | ||
| ``` |
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 | ||
sdb9696 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| library | ||
| contribute | ||
| SUPPORTED | ||
| ``` | ||
This file was deleted.
Oops, something went wrong.
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 | ||
| ``` |
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 | ||
|
|
||
sdb9696 marked this conversation as resolved.
Show resolved
Hide 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: | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.