Skip to content

Commit

Permalink
Merge pull request #12 from jfarmer08/Dev
Browse files Browse the repository at this point in the history
Update __init__.py
  • Loading branch information
jfarmer08 committed Aug 19, 2020
2 parents 367966b + 750c26c commit 6a2cbc2
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions custom_components/sengledapi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@
import voluptuous as vol

from .sengledapi.sengledapi import SengledApi
from .const import (
DOMAIN,
CONF_COUNTRY,
CONF_TYPE
)
from .const import DOMAIN, CONF_COUNTRY, CONF_TYPE

from homeassistant.const import CONF_DEVICES, CONF_PASSWORD, CONF_TIMEOUT, CONF_USERNAME
from homeassistant.helpers import discovery
Expand Down Expand Up @@ -41,7 +37,7 @@ async def async_setup(hass, config):
-------------------------------------------------------------------
Sengled Bulb Home Assistant Integration Created from Config
Version: v0.1-beta.9
Version: v0.1-beta.10
This is a custom integration
If you have any issues with this you need to open an issue here:
https://github.com/jfarmer08/ha-sengledapi
Expand Down Expand Up @@ -84,20 +80,16 @@ async def async_setup(hass, config):

return True


async def async_setup_entry(hass, entry):
"""Set up Sengled platform."""
username = entry.data[CONF_USERNAME]
password = entry.data[CONF_PASSWORD]
country = entry.data[CONF_COUNTRY]
bulbtype = entry.data[CONF_TYPE]

sengledapi_account = SengledApi(
username,
password,
country,
bulbtype,
)


sengledapi_account = SengledApi(username, password, country, bulbtype,)

await sengledapi_account.async_init()

if not sengledapi_account.is_valid_login():
Expand Down Expand Up @@ -125,4 +117,4 @@ async def async_setup_entry(hass, entry):
"SengledApi: SengledApi authenticated but could not find any devices."
)

return False
return False

0 comments on commit 6a2cbc2

Please sign in to comment.