Skip to content

Commit

Permalink
Updated examples (#14)
Browse files Browse the repository at this point in the history
* Update examples and documentation

* Update README.md
  • Loading branch information
DCSBL authored Feb 20, 2022
1 parent bdf689a commit 12dbd8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,12 @@ The example below is available as a runnable script in the repository.
from homewizard_energy import HomeWizardEnergy

# Make contact with a energy device
device = HomeWizardEnergy(args.host)
async with HomeWizardEnergy(args.host) as api:

# Update device value
await device.update()
# Use the data
print(await api.device())
print(await api.data())
print(await api.state())

# Use the data
print(device.device.product_name)
print(device.device.serial)
print(device.data.wifi_ssid)

# Close connection
await device.close()
await api.state_set(power_on=True)
```
File renamed without changes.

0 comments on commit 12dbd8f

Please sign in to comment.