Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielhiversen authored Jan 28, 2024
1 parent f1ab40d commit f178d0a
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,23 @@ import tibber.const
import tibber
import asyncio

access_token = tibber.const.DEMO_TOKEN
tibber_connection = tibber.Tibber(access_token, user_agent="change_this")

async def home_data():
async def start():
tibber_connection = tibber.Tibber(tibber.const.DEMO_TOKEN, user_agent="change_this")
await tibber_connection.update_info()
print(tibber_connection.name)

home = tibber_connection.get_homes()[0]
await home.fetch_consumption_data()
await home.update_info()
print(home.address1)

await home.update_price_info()
print(home.current_price_info)

# await tibber_connection.close_connection()

async def start():
await tibber_connection.update_info()
print(tibber_connection.name)
await home_data()
await tibber_connection.close_connection()

loop = asyncio.get_event_loop()
loop.run_until_complete(start())
loop = asyncio.run(start())
```


Expand Down

0 comments on commit f178d0a

Please sign in to comment.