Beispiel #1
0
    def __init__(self, name, username, password):
        """Initialize the TotalConnect status."""
        from total_connect_client import TotalConnectClient

        _LOGGER.debug("Setting up TotalConnect...")
        self._name = name
        self._username = username
        self._password = password
        self._state = STATE_UNKNOWN
        self._client = TotalConnectClient.TotalConnectClient(
            username, password)
Beispiel #2
0
    def __init__(self, name, username, password):
        """Initialize the TotalConnect status."""
        from total_connect_client import TotalConnectClient

        _LOGGER.debug("Setting up TotalConnect...")
        self._name = name
        self._username = username
        self._password = password
        self._state = None
        self._device_state_attributes = {}
        self._client = TotalConnectClient.TotalConnectClient(
            username, password)
Beispiel #3
0
def setup(hass, config):
    """Set up TotalConnect component."""
    conf = config[DOMAIN]

    username = conf[CONF_USERNAME]
    password = conf[CONF_PASSWORD]

    client = TotalConnectClient.TotalConnectClient(username, password)

    if client.token is False:
        _LOGGER.error("TotalConnect authentication failed")
        return False

    hass.data[DOMAIN] = TotalConnectSystem(username, password, client)

    for platform in TOTALCONNECT_PLATFORMS:
        discovery.load_platform(hass, platform, DOMAIN, {}, config)

    return True