Skip to content

Commit

Permalink
Change device_state_attributes to extra_state_attributes (fix for hom…
Browse files Browse the repository at this point in the history
…eassistant 2021.12.0)
  • Loading branch information
erikkastelec committed Dec 17, 2021
1 parent df78005 commit 5039931
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
5 changes: 3 additions & 2 deletions custom_components/wemportal/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
"documentation": "https://github.com/erikkastelec/hass-WEM-Portal",
"issue_tracker": "https://github.com/erikkastelec/hass-WEM-Portal/issues",
"dependencies": [],
"version": "1.2.0",
"version": "1.2.1",
"codeowners": [
"@erikkastelec"
],
"requirements": [
"scrapyscript==1.1.0",
"scrapy==2.4.1",
"fuzzywuzzy==0.18.0"
]
],
"iot_class": "cloud_polling"
}
2 changes: 1 addition & 1 deletion custom_components/wemportal/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def state_class(self):
return None

@property
def device_state_attributes(self):
def extra_state_attributes(self):
"""Return the state attributes of this device."""
attr = {}
if self._last_updated is not None:
Expand Down
4 changes: 2 additions & 2 deletions custom_components/wemportal/wemportalapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def parse(self, response):
def navigate_to_expert_page(self, response):
# sleep for 1 seconds to get proper language and updated data
time.sleep(1)
_LOGGER.debug("Print user page HTML: %s", response.text)
#_LOGGER.debug("Print user page HTML: %s", response.text)
if (
response.url
== "https://www.wemportal.com/Web/login.aspx?AspxAutoDetectCookieSupport=1"
Expand Down Expand Up @@ -481,7 +481,7 @@ def generate_form_data(self, response):
def scrape_pages(self, response):
# sleep for 1 seconds to get proper language and updated data
time.sleep(1)
_LOGGER.debug("Print expert page HTML: %s", response.text)
#_LOGGER.debug("Print expert page HTML: %s", response.text)
if self.authErrorFlag:
yield {"authErrorFlag": True}
_LOGGER.debug("Scraping page")
Expand Down

0 comments on commit 5039931

Please sign in to comment.