wave reader utils
1.1.0
此軟件包當前處於維護模式。請使用Airthings-Ble進行新項目。
Airthings Wave是一系列跟踪房屋中ra含量的設備。 ra是一種放射性氣體,來自土壤和岩石中鈾的崩潰。它是看不見的,無味的,無味的。
這是一個非正式的Airthings Wave社區庫,旨在為設備和Web通信提供公用事業。
bleak依賴性,用於平台交叉兼容性和對異步操作的支持。在Ubuntu/Debian中,請確保已安裝libglib2.0-dev和bluez :
sudo apt-get install libglib2.0-dev bluez -y其他Linux發行版應具有等效軟件包。從理論上講,其他平台(Windows,Mac)得到了使用bleak作為依賴性的支持,但是如果您遇到任何問題,請打開機票。
您可以通過運行安裝庫:
pip install wave-readerexamples目錄中有各種具體示例。這包括CLI互動和其他有趣的場景,這些場景證明了API使用情況。
import asyncio
from wave_reader import wave
if __name__ == "__main__" :
# Scan for BTLE Wave devices.
devices = wave . scan ()
# Event loop to run asynchronous tasks.
loop = asyncio . new_event_loop ()
# Get sensor readings from available wave devices.
for d in devices :
sensor_readings = loop . run_until_complete ( d . get_sensor_values ())
print ( sensor_readings )
# >>> DeviceSensors (humidity: 32.5, radon_sta: 116, radon_lta: 113 ... 此庫中的wave_reader/web模塊為Airthings Web API提供了客戶端。有關更多詳細信息,請參見此頁面。
如果確定錯誤,請打開票。始終歡迎拉動請求。
您可以通過運行tox運行整個測試套件。它將運行flake8 , isort和pytest 。如果您只想運行單元測試,則運行pytest ./tests就足夠了。