Add Ombi integration#26755
Conversation
There was a problem hiding this comment.
Code looks great!
Is there a chance that more platforms will be created for this integration, eg media_player, or custom services? In that case we should consider moving the config section to under the integration key and set up the sensor platform via discovery from the component module.
|
@MartinHjelmare |
|
I would recommend putting the config under the integration domain key instead and refactor to use https://github.com/home-assistant/home-assistant/blob/54242cd65c1d69d88ec366f545313cf003e9cbbb/homeassistant/helpers/discovery.py#L110 The ombi api instance should be created in the component and stored in hass.data, to later be accessible from the platform. |
|
Nice! |
|
I think everything should be included now. I separated the config from the sensor setup and added a couple of service calls for different types of requests. I've added in music support as well just for the sake of it. The only thing I'm a bit indecisive about is if I should implement some type of response on how each service request was handled, i.e. whether they succeeded or not. Let me know if you have any ideas for this. |
|
We can raise an error in the service handler on failure. This will be shown to the user. |
|
Please update the config example in the PR description. |
|
Great! Thanks for all the feedback, I'll make sure to update the docs. |
|
Ping me when the yaml example above is updated and I'll merge here. |
|
@MartinHjelmare Fixed! |
Description:
Integration for Ombi sensors and services.
Related issue (if applicable): N/A
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#10400
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest.requirements_all.txtby runningpython3 -m script.gen_requirements_all..coveragerc.