https://github.com/cryptomcgrath/sensorpush-bleak
Library to read from SensorPush temperature sensor using bleak
https://github.com/cryptomcgrath/sensorpush-bleak
Last synced: 10 months ago
JSON representation
Library to read from SensorPush temperature sensor using bleak
- Host: GitHub
- URL: https://github.com/cryptomcgrath/sensorpush-bleak
- Owner: cryptomcgrath
- License: mit
- Created: 2021-11-26T20:39:23.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-12T23:23:47.000Z (about 3 years ago)
- Last Synced: 2025-06-21T00:05:47.764Z (12 months ago)
- Language: Python
- Homepage:
- Size: 70.3 KB
- Stars: 4
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# pysensorpush-bleak
Python library which uses bleak to read temperature data from a Sensorpush HT.w temperature sensor.
1. Find the mac address of your sensor:
```
pi@raspberrypi:~ $ sudo hcitool lescan
LE Scan ...
A4:34:F1:7F:CD:D8 SensorPush HT.w CDD8
```
2. Example usage:
```
$ pip install sensorpush-bleak
...
Successfully installed sensorpush-bleak-1.0.7
$ 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.
>>> from sensorpush 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
>>>
```
