Skip to main content

No project description provided

Project description

./docs/switchbot.png

Python Swithbot Meter API

Comprehensible SwitchBot Meter API. Read your SwitchBot Meter status in real time via BLE.

pypi downloads python_versions pypi_versions coverage actions

Installation

This library is available on Pypi, you can install it directly with pip

pip install switchbotmeter

This library acts as a BLE client, so you need a BLE-capable device (a bluetooth dongle or integrated)

Usage

This library exports a DeviceScanner object that will dected any SwitchBot Meter devices nearby. Note that you need to have permissions to access your bluetooth device, the scope of wich will not be covered by this readme :

from switchbotmeter import DevScanner

for current_devices in DevScanner():
    for device in current_devices:
        print(device)
        print(f'{device.mac} -> {device.temp}')
<T temp: 19.8 humidity: 73> (c6:97:89:d6:c8:09)
c6:97:89:d6:c8:09 -> 19.8
...
<T temp: 20.4 humidity: 71> (c6:97:89:d6:c8:09)
c6:97:89:d6:c8:09 -> 20.4

If your device is shown but not returned by DevScanner, it wasn’t identified as a SwitchBot meter. In this case, pass the MAC address to DevScanner, e.g.:

DevScanner(macs=['c6:97:89:d6:c8:09'])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

switchbotmeter-0.0.1-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file switchbotmeter-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: switchbotmeter-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for switchbotmeter-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff47c3a7c6cf5aaa33e609aec68ac17f002c6326f19d900fe53d6dbf516b7246
MD5 6ffd5f20fd0db18e778a04bc2f2bf367
BLAKE2b-256 0f3320d10ac572dcd2bfa38017d1ca7e58b76b5bd1c23335ce6b92c0d6a68bcd

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