mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
proper access_token check
This commit is contained in:
parent
3b8c5d6833
commit
e76defe035
@ -37,12 +37,12 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||||||
name = config.get(CONF_NAME, DEFAULT_NAME)
|
name = config.get(CONF_NAME, DEFAULT_NAME)
|
||||||
channel_id = config.get("channel_id")
|
channel_id = config.get("channel_id")
|
||||||
|
|
||||||
if not access_token:
|
if access_token is None:
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Configuration Error"
|
"Configuration Error"
|
||||||
"Please make sure you have configured your access token " +
|
"Please make sure you have configured your access token " +
|
||||||
"that can be aquired from https://my.eliq.se/user/settings/api")
|
"that can be aquired from https://my.eliq.se/user/settings/api")
|
||||||
return None
|
return False
|
||||||
|
|
||||||
api = eliqonline.API(access_token)
|
api = eliqonline.API(access_token)
|
||||||
add_devices([EliqSensor(api, channel_id, name)])
|
add_devices([EliqSensor(api, channel_id, name)])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user