generated from ludeeus/integration_blueprint
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Checklist
- I have filled out the template to the best of my ability.
- This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
- This issue is not a duplicate feature request of previous feature requests.
Is your feature request related to a problem? Please describe.
The method by which entities are are accessed and controlled is not officially supported. They may be better alternative methods:
HomeAssistant-OptiSpark/custom_components/optispark/__init__.py
Lines 62 to 75 in 73a252b
| def get_entity(hass: HomeAssistant, entity_id: str): | |
| """Get the entity associated with entity_id. It could be owned by another integration. | |
| Accessing entities of other integrations does not seem to be supported. The method we use | |
| seems a bit dodgy. | |
| """ | |
| entity_reg: RegistryEntry = entity_registry.async_get(hass).async_get(entity_id) | |
| domain: str = entity_reg.platform | |
| entity_coordinator: DataUpdateCoordinator = hass.data[domain][entity_reg.config_entry_id] | |
| # Get the entity via the entity coordinator | |
| for update_callback, _ in entity_coordinator._listeners.values(): | |
| if update_callback.__self__.unique_id == entity_reg.unique_id: | |
| return update_callback.__self__ |
Describe the solution you'd like
Describe alternatives you've considered
Additional context
Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed