Skip to content
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

HA Release 2022.4 causes sensors to fail #62

Closed
HAEdwin opened this issue Apr 7, 2022 · 7 comments
Closed

HA Release 2022.4 causes sensors to fail #62

HAEdwin opened this issue Apr 7, 2022 · 7 comments

Comments

@HAEdwin
Copy link
Collaborator

HAEdwin commented Apr 7, 2022

sensor.py needs to be modified (no time to create pull request at this moment, this is my reminder here)
Add the following line:
from homeassistant.helpers.entity import EntityCategory
Replace:
entity_category="diagnostic"
for
entity_category=EntityCategory.DIAGNOSTIC

switch.py and binairy_sensor.py also fixed in my repository. If no comments are made on this fix I'll close this issue.

@otello86
Copy link

otello86 commented Apr 10, 2022

Hello
i do the update on sensor.py, it solved some problems but ECU_querying is still unavailable.
I saw 2 lines inswitch.py and binary_sensor.py which could be the reason :

switch.py:
@property def entity_category(self): return "config"
binary_sensor.py
@property def entity_category(self): return "diagnostic">

and I already have this error in logs :

Logger: homeassistant.components.switch
Source: helpers/entity_registry.py:529
Integration: Commutateur (documentation, issues)
First occurred: 08:43:44 (2 occurrences)
Last logged: 08:43:45

Error adding entities for domain switch with platform apsystems_ecur
Error while setting up apsystems_ecur platform for switch
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 510, in _async_add_entity
entry = entity_registry.async_get_or_create(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 345, in async_get_or_create
return self.async_update_entity(
File "/usr/src/homeassistant/homeassistant/helpers/entity_registry.py", line 529, in async_update_entity
raise ValueError("entity_category must be a valid EntityCategory instance")
ValueError: entity_category must be a valid EntityCategory instance

@Scholtz-i
Copy link

I have made all the changes from HAEdwin (Pull requests => File changed) and it works perfectly again.
Big thanks to HAEdwin.

@otello86
Copy link

Yes i saw, thanks

@HAEdwin
Copy link
Collaborator Author

HAEdwin commented Apr 10, 2022

For a quick reference I'll post the changes:

sensor.py ---------------------------------------------

image

binary_sensor.py ---------------------------------------------

image

switch.py ---------------------------------------------

image

@HAEdwin HAEdwin closed this as completed Apr 10, 2022
@TexTown
Copy link

TexTown commented Apr 11, 2022

In theory, shouldn't this be closed AFTER the PR that solves this was merged? (even better, have the PR do that automatically...)
I hope @ksheumaker can do that soon, I'm not updating HA until this fix is in the integration.

@HAEdwin
Copy link
Collaborator Author

HAEdwin commented Apr 11, 2022

You are soo right. Better for reference also (if one might encounter the same issue).

@ksheumaker
Copy link
Owner

Compatibility with 2022.4 fixed in release v1.2.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants