Fetch the latest state.

def async_update(self):
        """Fetch the latest state."""
        _LOGGER.debug('Calling update on Alarm.com')
        response = None
        if not self._login_info:
            yield from self.async_login()
        try:
            with async_timeout.timeout(10, loop=self._loop):
                response = yield from self._websession.get(
                    self.ALARMDOTCOM_URL + '{}/main.aspx'.format(
                        self._login_info['sessionkey']),
                    headers={'User-Agent': 'Mozilla/5.0 '
                                           '(Windows NT 6.1; '
                                           'WOW64; rv:40.0) '
                                           'Gecko/20100101 '
                                           'Firefox/40.1'}
                )

            _LOGGER.debug('Response from Alarm.com: %s', response.status)
            text = yield from response.text()
            _LOGGER.debug(text)
            tree = BeautifulSoup(text, 'html.parser')
            try:
                self.state = tree.select(self.ALARM_STATE)[0].get_text()
                _LOGGER.debug(
                    'Current alarm state: %s', self.state)
                self.sensor_status = tree.select(self.SENSOR_STATUS)[0].get_text()
                _LOGGER.debug(
                    'Current sensor status: %s', self.sensor_status)
            except IndexError:
                # We may have timed out. Re-login again
                self.state = None
                self.sensor_status = None
                self._login_info = None
                yield from self.async_update()
        except (asyncio.TimeoutError, aiohttp.ClientError):
            _LOGGER.error("Can not load login page from Alarm.com")
            return False
        finally:
            if response is not None:
                yield from response.release()