Client libary for Wiresense
- Send data to the wiresense frontend
- Works with almost every sensor
- Automaticly saved data into csv files
Install the libary with pip:
pip install wiresense
Import the libary and configure it
from wiresense import Wiresense
await Wiresense.config({
"port": 8080
})
Setup a new sensor (group)
def readSensorData():
# Replace with you actual sensor reading logic
return {
"Pressure": random.randint(0, 10),
"Humidity": random.randint(0, 10),
"Temperature": random.randint(0, 10),
}
sensor_1 = Wiresense('Fake-BME280', readSensorData, './data/sensor1_data.csv')
Execute a sensor (Send to frontend and save to file)
await sensor_1.execute()
Please note that Wiresense is an asynchronous library and requires execution within an asyncio event loop. Make sure to run the main function using asyncio.run() or within an existing asyncio application.