-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not compatible with Python 3.11 #17
Comments
Can you try to make a following change in the code (in __init__.py file) and check if it works? ...
- @asyncio.coroutine
- def async_added_to_hass(self):
- state = yield from self.async_get_last_state()
+ async def async_added_to_hass(self):
+ state = await self.async_get_last_state()
if state is not None \
and state.attributes is not None \
... |
After changing that a new error popups up:
|
It looks like you haven't applied all changes from the fragment I have posted above. The updated code should look the following way: @property
def state(self):
return len(self._entities_db) + len(self._variables_db)
async def async_added_to_hass(self):
state = await self.async_get_last_state()
if state is not None \
and state.attributes is not None \
and "variables" in state.attributes and not isinstance(state.attributes["entities"], list) \
and "entities" in state.attributes and not isinstance(state.attributes["variables"], list):
self._variables_db = state.attributes["variables"]
self._entities_db = state.attributes["entities"] |
Ah you're right. I only changed the first part earlier today. The full change seems to work fine as entity |
Great, thank you. I will adjust the integration 👍 |
Fixed in v1.1.5 |
After updating Python to 3.11 this component is failing:
The text was updated successfully, but these errors were encountered: