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():
|
||||
hub = neohub.NeoHub()
|
||||
await hub.connect()
|
||||
system = await hub.get_system()
|
||||
hub_data, thermostats = await hub.get_live_data()
|
||||
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()
|
||||
|
||||
print(await hub.target_temperature_step)
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
|
||||
#logging.basicConfig(level=logging.DEBUG)
|
||||
asyncio.run(run())
|
||||
|
|
|
@ -14,11 +14,8 @@ from neohubapi.neostat import NeoStat
|
|||
|
||||
|
||||
class NeoHub:
|
||||
def __init__(self):
|
||||
def __init__(self, host='Neo-Hub', port=4242):
|
||||
self._logger = logging.getLogger('neohub')
|
||||
pass
|
||||
|
||||
async def connect(self, host='Neo-Hub', port='4242'):
|
||||
self._host = host
|
||||
self._port = port
|
||||
|
||||
|
|
Loading…
Reference in New Issue