Skip to main content

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()

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

python-switchbot-1.0.0.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

python_switchbot-1.0.0-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page