Skip to content

Commit

Permalink
Fix async watthourmeter
Browse files Browse the repository at this point in the history
  • Loading branch information
hectorespert committed Jun 1, 2021
1 parent 6ff673e commit 75479c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ async def main():

watt = await connection.watthourmeter()
print(watt)
await connection.close()

asyncio.run(main())
```
Expand Down
2 changes: 1 addition & 1 deletion oligo/asyncio/asynciber.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ async def measurement(self) -> dict:

async def watthourmeter(self) -> float:
"""Returns your current power consumption."""
return await self.measurement()["consumption"]
return (await self.measurement())["consumption"]

async def icpstatus(self) -> bool:
"""Returns the status of your ICP."""
Expand Down

0 comments on commit 75479c8

Please sign in to comment.