forked from andrius/neohubapi
Move functionality of neohub.connect() into __init__.
This commit is contained in:
parent
da10de2d7a
commit
db381d04e4
|
@ -14,13 +14,14 @@ from neohubapi.enums import ScheduleFormat
|
||||||
|
|
||||||
async def run():
|
async def run():
|
||||||
hub = neohub.NeoHub()
|
hub = neohub.NeoHub()
|
||||||
await hub.connect()
|
|
||||||
system = await hub.get_system()
|
system = await hub.get_system()
|
||||||
hub_data, thermostats = await hub.get_live_data()
|
hub_data, thermostats = await hub.get_live_data()
|
||||||
for device in thermostats:
|
for device in thermostats:
|
||||||
print(f"Temperature in zone {device.name}: {device.temperature}")
|
print(f"Target temperature of {device.name}: {device.target_temperature}")
|
||||||
await device.identify()
|
await device.identify()
|
||||||
|
|
||||||
|
print(await hub.target_temperature_step)
|
||||||
|
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
|
||||||
|
#logging.basicConfig(level=logging.DEBUG)
|
||||||
asyncio.run(run())
|
asyncio.run(run())
|
||||||
|
|
|
@ -14,11 +14,8 @@ from neohubapi.neostat import NeoStat
|
||||||
|
|
||||||
|
|
||||||
class NeoHub:
|
class NeoHub:
|
||||||
def __init__(self):
|
def __init__(self, host='Neo-Hub', port=4242):
|
||||||
self._logger = logging.getLogger('neohub')
|
self._logger = logging.getLogger('neohub')
|
||||||
pass
|
|
||||||
|
|
||||||
async def connect(self, host='Neo-Hub', port='4242'):
|
|
||||||
self._host = host
|
self._host = host
|
||||||
self._port = port
|
self._port = port
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue