Register Wemo fan services with entity service helper#44192
Conversation
|
It would help if I give more background on what I'm hoping to accomplish:
The future PR above will change the Wemo component to use a config entry per device. I'm trying to separate that large PR into more manageable parts. That PR also adds support for
Is it okay to use a service helper when there are multiple entities? Given the above background, will I run into issues with registering a service multiple times under the same name? |
|
I'm not sure that a config entry per device is the best approach. We try to avoid doing that. |
Doh! This PR may be unnecessary then. Would you recommend I run the pywemo SSDP discovery periodically in the background? Or is there another way to use the hass SSDP discovery component and maintain a single config entry (is there an example component that does this)? |
|
Yes, I'd recommend running the discovery periodically. I'm not sure that there's a standard for reusing the ssdp integration. |
|
The entity service helper will make sure to keep track of entities and target the correct one. |
Proposed change
Use an entity service helper to register the Wemo fan services. This avoids the custom
service_handlethat is currently registered inasync_setup_entry.Type of change
Additional information
Checklist
black --fast homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all..coveragerc.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: