This library provides easy-use to switchbot API.
Project description
Switchbot library for python
I am Japanese student. I may use wrong English.
Description
This library provides easy use to SwitchBotAPI.
usage
from pprint import pprint
from switchbot_api.api import SwitchbotAPI
from switchbot_api.devices import *
import time
sAPI = SwitchbotAPI(
token="",
secret=""
)
devices = sAPI.devices
smart_plug: PlugMiniJP = devices[0]
print("target:", smart_plug)
pprint(sAPI.status(smart_plug))
print("turn on")
sAPI.run(smart_plug.command_turn_on())
time.sleep(3)
print("turn off")
sAPI.run(smart_plug.command_turn_off())
Limitation
This library can onlyget status and operate your devices. Not compatible with Scenes and Webhook.
Device
I have only Plug Mini (JP). I cannot debug other devices.
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
easy-switchbot-0.0.4.tar.gz
(14.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file easy-switchbot-0.0.4.tar.gz.
File metadata
- Download URL: easy-switchbot-0.0.4.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00754d2293252b72fa851175196404ce437ac889746375c5bec6a98423828655
|
|
| MD5 |
0d4655cdc6f91872ffa786c6c5fc54d3
|
|
| BLAKE2b-256 |
ac6323916490ecc616627cabfaa394f8cb61365b81707d43c83bb86a356c6eaa
|
File details
Details for the file easy_switchbot-0.0.4-py3-none-any.whl.
File metadata
- Download URL: easy_switchbot-0.0.4-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76047ad6fc222125962fda04ec030bd97a390007b9adf30b2ad5aa01209e1ec4
|
|
| MD5 |
befab5c5d219bb5ad4b6bab5de3d1f52
|
|
| BLAKE2b-256 |
651c9e472e352a30fe9f15446203ca693c958ae39baf7b2fadbb5e2c6c9a8e6f
|