library to read from Sensorpush HW.t bluetooth sensor
Project description
pysensorpush-bleak
Python library which uses gatttool to read temperature data from a Sensorpush HT.w temperature sensor.
- Find the mac address of your sensor:
pi@raspberrypi:~ $ sudo hcitool lescan
LE Scan ...
A4:34:F1:7F:CD:D8 SensorPush HT.w CDD8
- Example usage:
pi@raspberrypi:~/p/pysensorpush-bleak/src/pysensorpush-bleak $ python
Python 3.9.2 (default, Mar 12 2021, 04:06:34)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sensorpush as sp
>>> import asyncio
>>> from bleak import BleakClient
>>> async def main():
... client = BleakClient("A4:34:F1:7F:CD:D8")
... await client.connect()
... temp_c = await sp.read_temperature(client)
... print("temperature = {}".format(temp_c))
... client.disconnect()
...
>>> asyncio.run(main())
temperature = 13.92
>>>
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
sensorpush-bleak-1.0.7.tar.gz
(8.1 kB
view hashes)
Built Distribution
Close
Hashes for sensorpush_bleak-1.0.7-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ffe512834900550ec889441f1119bfbcc07e131a688d80d46a59eb26e745d11 |
|
MD5 | 7882d60ecd03f8aafc67d6aac1d4740b |
|
BLAKE2b-256 | e5e689c4ba4d5487b870c28ea99c2e9c460554ccfa310d4dcd111809ef27e550 |