A Python library to control SwitchBot devices connected to SwitchBot Hub
Project description
python-switchbot
A Python library to control SwitchBot devices connected to SwitchBot Hub
Requirements
Installation
pip install python-switchbot
Usage
from switchbot import SwitchBot
switchbot = SwitchBot('your@account.com')
switchbot.authenticate('yourpassword')
device = switchbot.device('AA:BB:CC:DD:EE:FF') # Device's BLE MAC
print(f'Current state: {device.state}')
# To turn off
device.turn('off') # -> device.state == 'off'
# To turn on
device.turn('on') # -> device.state == 'on'
# To toggle,
device.toggle()
Contributors
Thanks to all contributors!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
python-switchbot-1.0.3.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for python_switchbot-1.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff5bbd75c249c9b69fe0c4f0a15cbcff3f1e076a1ca06998789a31fb44438856 |
|
MD5 | 3076f245ca7a835822e7c0b181cca0ac |
|
BLAKE2b-256 | 21ff973d6a12cfcf97ee7209a5a34e613d8ed4b4c22c8c5e54014543964a2ef6 |