Skip to content

v0.4.0

Choose a tag to compare

@ericbstie ericbstie released this 20 Jan 12:50
· 59 commits to master since this release

Changelog v0.4.0 🎉

  • Asynchronous callback functions. Functions should now be defined with the async def syntax!

Dev changes:

  • Code now follows black and flake8 format and uses isort to sort imports.
  • Pytests now use a session-scoped fixture "account" to avoid spamming the Tibber API by creating this fixture for each test individually. (This improved test speeds significantly too!)

How to define callbacks now:

import tibber

account = tibber.Account(<your token>)
home = account.homes[0]

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

home.start_live_feed()