Skip to content

Wiresense/wiresense.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wiresense.py

wiresense.py

made with love asyncio build status pypi version pypi downloads

Client libary for Wiresense

🛠️Features

  • Send data to the wiresense frontend
  • Works with almost every sensor
  • Automaticly saved data into csv files

📖Usage

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.

📜License

MIT

✍️Authors