mirror of
https://github.com/Andre0512/hon.git
synced 2025-05-27 13:14:14 -04:00
New pyhOn version
This commit is contained in:
parent
e1a2af70e9
commit
7e9202ef38
9 changed files with 31 additions and 32 deletions
|
@ -1,7 +1,7 @@
|
|||
import logging
|
||||
|
||||
import voluptuous as vol
|
||||
from pyhon import HonConnection
|
||||
from pyhon import Hon
|
||||
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
|
||||
|
@ -28,8 +28,7 @@ CONFIG_SCHEMA = vol.Schema(
|
|||
|
||||
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry):
|
||||
session = aiohttp_client.async_get_clientsession(hass)
|
||||
hon = HonConnection(entry.data["email"], entry.data["password"], session)
|
||||
await hon.setup()
|
||||
hon = await Hon(entry.data["email"], entry.data["password"], session=session).create()
|
||||
hass.data.setdefault(DOMAIN, {})
|
||||
hass.data[DOMAIN][entry.unique_id] = hon
|
||||
hass.data[DOMAIN]["coordinators"] = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue