BeatsuDev / tibber.py

An UNOFFICIAL python wrapper for the nordic electricity company Tibber's API.
MIT License
17 stars 2 forks source link

Asynchronous callback functions for live data #31

Closed BeatsuDev closed 1 year ago

BeatsuDev commented 1 year ago

Now the syntax will be like this:

@home.event("live_measurement")
async def prcoess_data(data):
    print(data.power)

vs previously:

@home.event("live_measurement")
def prcoess_data(data):
    print(data.power)

This allows for all callback functions to be run asynchronously (at the same time) instead of sequentially when multiple callback functions are registered.