* Host should be optional for apcupsd component (#3072) * Zwave climate Bugfix: if some setpoints have different units, we should fetch the o… (#3078) * Bugfix: if some setpoints have different units, we should fetch the one that are active. * Move order of population for first time detection * Default to config if None unit_of_measurement * unit fix (#3083) * humidity slider (#3088) * If device was off target temp was null. Default to Heating setpoint (#3091) * Fix for BLE device tracker (#3019) * Bug fix tracked devices * Added scan_duration configuration parameter * fix homematic climate implementation (#3114) * Allow 'None' MAC to be loaded from known_devices (#3102) * Climate and cover bugfix (#3097) * Avoid None comparison for zwave cover. * Just rely on unit from config for unit_of_measurement * Explicit return None * Mqtt (#11) * Explicit return None * Missing service and wrong service name defined * Mqtt state was inverted, and never triggering * Fixed Homematic cover (#3116) * Add missing docstrings (fix PEP257 issues) (#3098) * Add missing docstrings (fix PEP257 issues) * Finish sentence * Merge pull request #3130 from turbokongen/zwave_fixes Bugfix. climate and covermqt * Back out insteon hub and fan changes (#3062) * Bump version * Special frontend build for 0.27.2
44 lines
1.1 KiB
Python
44 lines
1.1 KiB
Python
"""
|
|
Support for Insteon Hub.
|
|
|
|
For more details about this component, please refer to the documentation at
|
|
https://home-assistant.io/components/insteon_hub/
|
|
"""
|
|
import logging
|
|
|
|
from homeassistant.const import CONF_API_KEY, CONF_PASSWORD, CONF_USERNAME
|
|
from homeassistant.helpers import validate_config, discovery
|
|
|
|
DOMAIN = "insteon_hub"
|
|
REQUIREMENTS = ['insteon_hub==0.4.5']
|
|
INSTEON = None
|
|
_LOGGER = logging.getLogger(__name__)
|
|
|
|
|
|
def setup(hass, config):
|
|
"""Setup Insteon Hub component.
|
|
|
|
This will automatically import associated lights.
|
|
"""
|
|
if not validate_config(
|
|
config,
|
|
{DOMAIN: [CONF_USERNAME, CONF_PASSWORD, CONF_API_KEY]},
|
|
_LOGGER):
|
|
return False
|
|
|
|
import insteon
|
|
|
|
username = config[DOMAIN][CONF_USERNAME]
|
|
password = config[DOMAIN][CONF_PASSWORD]
|
|
api_key = config[DOMAIN][CONF_API_KEY]
|
|
|
|
global INSTEON
|
|
INSTEON = insteon.Insteon(username, password, api_key)
|
|
|
|
if INSTEON is None:
|
|
_LOGGER.error("Could not connect to Insteon service.")
|
|
return
|
|
|
|
discovery.load_platform(hass, 'light', DOMAIN, {}, config)
|
|
|
|
return True
|