Tasmota Device Controller
This packag provides async wrappers for Tasmota's web request API.
Only very few requests are implemented so far! If you need other requests, please have a look at the section Contributing, or create an issue.
get methods return the value of the fetched item, set methods return the new set value (so what the get method would return after the set). However there are some exceptions like BLINK for setPower() which always returns True, but that should be mentioned in the methods description.
Since this package was created for a Home Assistant integration, you can check out that integration for other sample usage.
Example usage:
import asyncio
from tasmotadevicecontroller import TasmotaDevice
from tasmotadevicecontroller import tasmota_types as t
async def main():
device = await TasmotaDevice.connect('192.168.10.21')
# Get friendly name (of first output, which is the default output)
nameResult = await device.getFriendlyName()
print(nameResult) # Returns 'My Tasmota Plug'
# Get power of first output
getResult = await device.getPower()
print(getResult) # Returns True (on)
# Set power of first output to on
setResult = await device.setPower(t.PowerType.TOGGLE)
print(setResult) # Returns True or False (depending if the device was switched on or off)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Contributing
If you want to add new requests, can implement these commands and create a merge request on GitHub.
Almost every command is implemented as one getter method and one setter method. Add your command if possible in the same way inside the TasmotaDevice class. Remember to add descriptions to each method. This description can usually be taken from the Tasmota wiki.
Also, remember to always use async await!
If the command takes values from a specific set of values, create an Enum inside tasmota_types.py for it.
Metadata
Release files for tasmotadevicecontroller 0.0.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tasmotadevicecontroller-0.0.8.tar.gz | 5.2 kB | Without provenance | Details for tasmotadevicecontroller-0.0.8.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tasmotadevicecontroller-0.0.8-py3-none-any.whl | Python 3 | none | any | Details for tasmotadevicecontroller-0.0.8-py3-none-any.whl |
Total release size: 25.6 kB
Release files / tasmotadevicecontroller-0.0.8.tar.gz
| Download URL | tasmotadevicecontroller-0.0.8.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
798758e148adb673f629f52578a6195ebde4b3aa8957f6697658cf794bfd80d6
|
|
BLAKE2b-256 checksum How to use checksums |
decd277e5d6eae4d09175a189990f59cc3d36eb2a7a63abc2c4359bffc917b9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Release files / tasmotadevicecontroller-0.0.8-py3-none-any.whl
| Download URL | tasmotadevicecontroller-0.0.8-py3-none-any.whl |
|---|---|
| Size | 20.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0df2b71529e368032431310aa913b01a148bf20750c2124ec498c6498b7e0dcc
|
|
BLAKE2b-256 checksum How to use checksums |
fcf0120f5eb897f34800e1a70146bd32a54933445a866b423e822fa654f39662
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
|
Security for tasmotadevicecontroller 0.0.8
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.