Update README to new API.
This commit is contained in:
parent
7893ed66fd
commit
ec92300199
13
README.md
13
README.md
|
@ -3,26 +3,25 @@
|
||||||
SPDX-License-Identifier: CC-BY-4.0
|
SPDX-License-Identifier: CC-BY-4.0
|
||||||
-->
|
-->
|
||||||
|
|
||||||
# Neohubapi
|
# NeoHubAPI
|
||||||
|
|
||||||
This is a simple python wrapper around Heatmiser's Neohub API.
|
This is a simple python wrapper around Heatmiser's Neohub API.
|
||||||
|
|
||||||
|
It's primary purpose is to be used via Home Assistant integration but
|
||||||
|
it can also be used as a standalone library.
|
||||||
|
|
||||||
## Usage example
|
## Usage example
|
||||||
|
|
||||||
```python
|
```python
|
||||||
import asyncio
|
import asyncio
|
||||||
import datetime
|
|
||||||
import logging
|
|
||||||
import neohubapi.neohub as neohub
|
import neohubapi.neohub as neohub
|
||||||
|
|
||||||
from neohubapi.enums import ScheduleFormat
|
|
||||||
|
|
||||||
|
|
||||||
async def run():
|
async def run():
|
||||||
hub = neohub.NeoHub()
|
hub = neohub.NeoHub()
|
||||||
system = await hub.get_system()
|
system = await hub.get_system()
|
||||||
hub_data, thermostats = await hub.get_live_data()
|
hub_data, devices = await hub.get_live_data()
|
||||||
for device in thermostats:
|
for device in devices['thermostats']:
|
||||||
print(f"Temperature in zone {device.name}: {device.temperature}")
|
print(f"Temperature in zone {device.name}: {device.temperature}")
|
||||||
await device.identify()
|
await device.identify()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue