Skip to main content

A library to communicate with Switchbot

Project description

pySwitchbot Build Status

Library to control Switchbot IoT devices https://www.switch-bot.com/bot

Obtaining locks encryption key

Using the script scripts/get_encryption_key.py you can manually obtain locks encryption key.

Usage:

$ python3 get_encryption_key.py MAC USERNAME
Key ID: xx
Encryption key: xxxxxxxxxxxxxxxx

Where MAC is MAC address of the lock and USERNAME is your SwitchBot account username, after that script will ask for your password. If authentication succeeds then script should output your key id and encryption key.

Examples:

  • WoLock
import asyncio
from switchbot.discovery import GetSwitchbotDevices
from switchbot.devices import lock


async def main():
    wolock = await GetSwitchbotDevices().get_locks()
    await lock.SwitchbotLock(wolock['32C0F607-18B8-xxxx-xxxx-xxxxxxxxxx'].device, "key-id", "encryption-key").get_lock_status()


asyncio.run(main())

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

pyswitchbot-0.53.2.tar.gz (33.7 kB view details)

Uploaded Source

Built Distribution

PySwitchbot-0.53.2-py3-none-any.whl (44.0 kB view details)

Uploaded Python 3

File details

Details for the file pyswitchbot-0.53.2.tar.gz.

File metadata

  • Download URL: pyswitchbot-0.53.2.tar.gz
  • Upload date:
  • Size: 33.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pyswitchbot-0.53.2.tar.gz
Algorithm Hash digest
SHA256 7824dafcb3570f59a82289b3cdc4f21330d0382cf2a9e9cf9e349551c63c39be
MD5 a4a8c101ae931ac8527bdb49c3b81695
BLAKE2b-256 d452dc106ce0a3aaa33b84f5ae9d7b707a72dd5e763b1a8464cabd5a42775275

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyswitchbot-0.53.2.tar.gz:

Publisher: python-publish.yml on sblibs/pySwitchbot

Attestations:

File details

Details for the file PySwitchbot-0.53.2-py3-none-any.whl.

File metadata

  • Download URL: PySwitchbot-0.53.2-py3-none-any.whl
  • Upload date:
  • Size: 44.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for PySwitchbot-0.53.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fe5f14fe26b36fba53a563721c4352d568d1d4a21c0f6265f52d03133708e93f
MD5 7aa6c96234f5797c83c74cfad991397c
BLAKE2b-256 62a26a7a5c1577067163a798cf673250a43182c34d02812a31cab3dfacb308ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for PySwitchbot-0.53.2-py3-none-any.whl:

Publisher: python-publish.yml on sblibs/pySwitchbot

Attestations:

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