Skip to main content

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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

easy_switchbot-0.0.4-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

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

Hashes for easy-switchbot-0.0.4.tar.gz
Algorithm Hash digest
SHA256 00754d2293252b72fa851175196404ce437ac889746375c5bec6a98423828655
MD5 0d4655cdc6f91872ffa786c6c5fc54d3
BLAKE2b-256 ac6323916490ecc616627cabfaa394f8cb61365b81707d43c83bb86a356c6eaa

See more details on using hashes here.

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

Hashes for easy_switchbot-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 76047ad6fc222125962fda04ec030bd97a390007b9adf30b2ad5aa01209e1ec4
MD5 befab5c5d219bb5ad4b6bab5de3d1f52
BLAKE2b-256 651c9e472e352a30fe9f15446203ca693c958ae39baf7b2fadbb5e2c6c9a8e6f

See more details on using hashes here.

Supported by

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