krahabb / meross_lan

Home Assistant integration for Meross devices
MIT License
423 stars 47 forks source link

Error from HA logs "adding entities for domain cover with platform meross_lan" #195

Closed Duke-Box closed 2 years ago

Duke-Box commented 2 years ago

Version of the custom_component

2.5.8

Configuration

via UI


Add your logs here.

Describe the bug

Error from HA log on start up "adding entities for domain cover with platform meross_lan"

Debug log


 Logger: homeassistant.components.cover
Source: custom_components/meross_lan/cover.py:94
Integration: Cover (documentation, issues)
First occurred: 20:12:43 (4 occurrences)
Last logged: 20:48:08

Error adding entities for domain cover with platform meross_lan
Error while setting up meross_lan platform for cover
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 382, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 619, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 809, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/config/custom_components/meross_lan/cover.py", line 94, in async_added_to_hass
    last_state = history.get_state(self.hass, utcnow(), self.entity_id)
AttributeError: module 'homeassistant.components.recorder.history' has no attribute 'get_state'
krahabb commented 2 years ago

Hello @Duke-Box , I guess this is something from the 2022.6.X HA core. I didn't have the time to test it against meross_lan and I'm sorry for the issue. I need to fix it in code (sooner than later) Thank you for posting this