Releases: ericbstie/tibber.py
Releases · ericbstie/tibber.py
v0.7.1
Changelog
- Adds the
fetch_price_info(resolution: Literal["HOURLY", "QUARTER_HOURLY"]) -> PriceInfomethod on theSubscriptionobject. - Fixes wrong return type for
fetch_price_info_range(previously returned PriceInfo when it actually returns SubscriptionPriceConnection).
Fetch todays and tomorrows price:
import tibber
account = tibber.Account(tibber.DEMO_TOKEN)
subscription = account.homes[0].current_subscription
# QUARTER_HOURLY or HOURLY
price_info = subscription.fetch_price_info("QUARTER_HOURLY")
price_info.today # List of 96 Price objects
price_info.tomorrow # This data is populated once a dayv0.7.0
Quarterly resolution price info
There are still some endpoints that are yet to be implemented, but for now you can get quarterly resolution price info like this:
import tibber
account = tibber.Account(tibber.DEMO_TOKEN)
subscription = account.homes[0].current_subscription
# The API requires the date to be passed as a base64 encoded string with timezone information
date = datetime.datetime(2025, 1, 1, 0, 0, 0)
encoded_date = base64.b64encode(date.astimezone().isoformat().encode("utf-8")).decode("utf-8")
# QUARTER_HOURLY, HOURLY or DAILY
connection = subscription.fetch_price_info_range("QUARTER_HOURLY", first=10, after=encoded_date)
connection.nodes # A list of Price objectsv0.6.0
Breaking change
tibber.py now verifies SSL connections on query execution by default.
This behvaiour (and other transport-related arguments) can be passed to the Account class like this:
import tibber
tibber.Account("TOKEN", transport_kwargs={ "ssl": True })
v0.5.0
What's Changed
- Support for older Python versions by @BeatsuDev in #41
- fix: method name by @tpd-opitz in #49
- Ability to search for price info in historical data by @BeatsuDev in #56
New Contributors
- @tpd-opitz made their first contribution in #49
Full Changelog: v0.4.0...v0.5.0
v0.4.0
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()v0.3.0
Changelog v0.3.0 🎉
- A lot of improvements to the realtime data websocket connection! The bug where "Connection limit reached: 2" occurs should be improved (should occur less frequently. I'm still needing to monitor and work on this).
start_live_feed()now checks if realtime consumption is enabled before connecting to the websocket.- Added the
tibber.Account.update()method: An alias forfetch_all() - Much better logging for websocket information
- QueryExecutor now uses a permanent session instead of creating a whole new session for each request.
Enable logging:
import logging
logging.basicConfig()
logger = logging.getLogger("tibber")
logger.setLevel(logging.DEBUG)
import tibber
<your code here>v0.2.1
v0.2.0
Changelog v0.2.0 🎉
-
Realtime information is now retrieved differently, using the
graphql-transport-wssubprotocol (see issue #16) and using the third-party modulesgql(and gql[websockets]) andgraphql-core. -
BREAKING: A tiny breaking change to the home object too:
home.start_livefeed()has now been renamed tohome.start_live_feed().
v0.1.1
v0.1.0
Changelog v0.1.0 🎉
- BREAKING: Changed
tibber.Clienttotibber.Account - Much more docs! Check it out https://tibberpy.readthedocs.io/en/latest/.
- More test coverage!
- Get historical data!