Closed HAEdwin closed 2 years ago
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
I have made all the changes from HAEdwin (Pull requests => File changed) and it works perfectly again. Big thanks to HAEdwin.
Yes i saw, thanks
For a quick reference I'll post the changes:
sensor.py ---------------------------------------------
binary_sensor.py ---------------------------------------------
switch.py ---------------------------------------------
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.
You are soo right. Better for reference also (if one might encounter the same issue).
Compatibility with 2022.4 fixed in release v1.2.12
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"
forentity_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.