Login using username / password and get the first auth token

def _login(self):
        """
        Login using username / password and get the first auth token
        """
        headers = {
            "Content-Type": "application/x-www-form-urlencoded",
            "Accept": "application/json"
        }

        url = self.api_base_url + "account/directlogin"

        data = {'Email': self.username,
                'Password': self.password,
                'RememberMe': 'True'}

        response = requests.post(url, data=data, headers=headers, timeout=10)

        if response.status_code != 200:
            return False

        self.login_data = response.json()
        if not self.login_data['isSuccess']:
            self.login_data = None
            return False

        if ('token' in self.login_data
                and 'accessToken' in self.login_data['token']):
            self.home_id = self.login_data['token']['currentHomeId']
            self.user_id = self.login_data['token']['userId']
            return True

        self.login_data = None
        return False