diff --git a/README.md b/README.md index 9e7c800..bde9b4f 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Add the following to your `configuration.yaml` file: # Example configuration.yaml entry sensor: - platform: wemportal - #scan_interval: 900 + #scan_interval: 1800 username: your_username password: your_password resources: diff --git a/custom_components/wemportal/const.py b/custom_components/wemportal/const.py index fd723a9..a829288 100644 --- a/custom_components/wemportal/const.py +++ b/custom_components/wemportal/const.py @@ -1,8 +1,7 @@ """ Constants for the WEM Portal Integration """ - import logging -_LOGGER = logging.getLogger('wemportal') +_LOGGER = logging.getLogger('custom_component.wemportal') DOMAIN = "wemportal" DEFAULT_NAME = "Weishaupt WEM Portal" DEFAULT_TIMEOUT = 60 diff --git a/custom_components/wemportal/manifest.json b/custom_components/wemportal/manifest.json index 3aa0960..9bf6e1a 100644 --- a/custom_components/wemportal/manifest.json +++ b/custom_components/wemportal/manifest.json @@ -4,7 +4,7 @@ "documentation": "https://github.com/erikkastelec/hass-WEM-Portal", "issue_tracker": "https://github.com/erikkastelec/hass-WEM-Portal/issues", "dependencies": [], - "version": "1.0.2", + "version": "1.0.3", "codeowners": [ "@erikkastelec" ], diff --git a/custom_components/wemportal/wemportalapi.py b/custom_components/wemportal/wemportalapi.py index 6e5c6e8..0fe2841 100644 --- a/custom_components/wemportal/wemportalapi.py +++ b/custom_components/wemportal/wemportalapi.py @@ -13,7 +13,7 @@ class WemPortalApi(object): - """ Wrapper class to the Atag One API """ + """ Wrapper class for Weishaupt WEM Portal""" def __init__(self, username, password): self.data = None @@ -61,12 +61,13 @@ def parse(self, response): callback=self.navigate_to_expert_page) def navigate_to_expert_page(self, response): + _LOGGER.debug("Print user page HTML: %s", response.text) if response.url == 'https://www.wemportal.com/Web/login.aspx?AspxAutoDetectCookieSupport=1': - _LOGGER.debug("Authhentication failed") + _LOGGER.debug("Authentication failed") self.authErrorFlag = True form_data = {} else: - _LOGGER.debug("Authhentication successful") + _LOGGER.debug("Authentication successful") form_data = self.generate_form_data(response) _LOGGER.debug("Form data processed") return FormRequest(url='https://www.wemportal.com/Web/default.aspx', @@ -102,6 +103,7 @@ def generate_form_data(self, response): } def scrape_pages(self, response): + _LOGGER.debug("Print expert page HTML: %s", response.text) if self.authErrorFlag: yield {'authErrorFlag': True} _LOGGER.debug("Scraping page")