Control Tasmota devices via their web api
Project description
Tasmota Device Controller
This packag provides 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.
Example usage:
from tasmotadevicecontroller import TasmotaDevice
from tasmotadevicecontroller import tasmota_types as t
device = TasmotaDevice('192.168.1.20')
# Get friendly name (of first output, which is the default output)
getResult = device.getFriendlyName()
print(getResult) # Returns {'FriendlyName1': 'My Tasmota Plug'}
# Set power of first output to on
setResult = device.setPower(t.PowerType.ON)
print(setResult) # Returns {'POWER': 'ON'}
Contributing
If you want to add new requests, can implement these commands and create a merge request on GitHub.
For every request there should be one class inside tasmota_commands.py
inheriting from the _Command
class. Make sure to add a comment to the new class, describing the command. This description can usually be taken from the Tasmota wiki.
If the command takes values from a specific set of values, create an Enum
inside tasmota_types.py
for it.
You should now also add one or more methods to the TasmotaDevice
wrapping these commands for ease of use.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file tasmotadevicecontroller-0.0.3.tar.gz
.
File metadata
- Download URL: tasmotadevicecontroller-0.0.3.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 63117cfb855a5983c401b48aa2cd5cc8b6b34722539da2d6df0f7f31e89582f6 |
|
MD5 | bd24af063b79bc0ab0d7e95abcf4453b |
|
BLAKE2b-256 | e2e3b974803847cd0350e83dcdc2b4086b7bbeace9fe08c4af3feaefe7e8341b |
File details
Details for the file tasmotadevicecontroller-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: tasmotadevicecontroller-0.0.3-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using 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
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29d1ca3cd2b7284df4c5bcc0dbd4ab05355574eca7567e90be6a712d9ad971f7 |
|
MD5 | 8be0c048cb450ea043a06f662a4e47e5 |
|
BLAKE2b-256 | c61a67b4ed2e71481955eb12e405e934ad4838de63d2ba1aff056b12475c5dcb |