-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
Homematic Support (clean) #2368
Conversation
config = {component.DOMAIN: found_devices} | ||
|
||
# Ensure component is loaded | ||
homeassistant.bootstrap.setup_component( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of line 165-180, you can use:
from homeassistant.helpers import discovery
discovery.load_platform(hass, component, DOMAIN, {
ATTR_DISCOVERED_DEVICES: found_devices
}, config)
Please note here that it is very important that you pass the config that you get in setup(hass, config)
. If you don't, you will break configs because for example the users switch config is now being ignored!
This is awesome ! 💃 🍺 👍 I've added a few comments. Mainly around the flow how the main component is loading its children components. |
As an explanation why we allow both auto detection and manually configuring interfaces: An example: There is a motion detector device, which basically is 6 devices in 1.
When using autodetection, all these get created correctly as their corresponing HA-entity. But the buttons are actually not relevant within the UI. For this case we have added the option to configure an entity to be hidden. That way the entity and it's state can be used for automations, but does not clutter the UI. Essentially the badge would at max flicker when the button is being pressed, but doesn't serve any other interactive purpose. Hence we provide the choice to hide it, resulting in a clean UI. To demonstrate how a configuration without names and hidden binary_sensors looks like when a lot of devices are present (and it doesn't even show all because of the height), here's a screenshot: I hope this is a valid reason to stick to this approach. |
Breaking up the platform setup for discovery/config is good. I don't mind supporting both and the new approach is 👍 The quality of the code is high and that's awesome 💯 This is ready to be merged 🐬 To limit the number of entities, there is no need to create an entity for button presses. Instead, you should consider firing an event. Z-Wave does it like this for example for when a scene gets activated (source). Anyway, that's not for this PR, that will be for the future. Moving forward, I'll be less picky when you submit PRs on the homematic code as we're having a solid foundation. I'll be giving you commit access so you can improve it yourself over time. I'll also not squash your commits to ensure that your collaboration will not get lost in history :-) |
Description:
Adding bi-directional Homematic support. This includes lots of actors (switches, rollershutters etc.), thermostats and sensors (motion, brightness, shutter contacts etc.). I roughly estimate that we cover more than 60% (maybe even more) of all the currently available Homematic RF products, which are widely spread in Europe (primarily Germany, Austria and Switzerland).
Configuration of devices might be complex, but we'll cover that in the documentation (working on that). Basic setup is described within the component/platform files.
We also have an (experimental) autodetect feature, which discovers and configures every device we're capable of handling, although without friendly names. But for beginners this will quickly show which of their devices are supported and can be manually configured accordingly.
Thanks to @danielperna84 for leading this project and the pyhomematic module
Thanks to @jazzaj for starting the Homematic implementation based on pyhomematic.
Thanks to @pvizeli for making radical improvements to pyhomematic and jazzajs implementation.
Thanks to @bimbar for support of MAX! Thermostats.
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#586
Example entry for
configuration.yaml
(if applicable):Checklist:
If user exposed functionality or configuration variables are added/changed:
If code communicates with devices:
tox
run successfully. Your PR cannot be merged unless tests passREQUIREMENTS
variable (example).requirements_all.txt
by runningscript/gen_requirements_all.py
..coveragerc
.