Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Adds light switch platform #18562
This PR adds the Light Switch Platform.
This platform can create a light based on a switch. We've seen a lot of PR in that past to modify the domain a switch is in. This is mainly because people want to have a switch acting as a light. Many components have limited their use to entities in the light domains only (e.g. Light Group), which makes it impossible to use a switch entity in those cases. Another example, having switches showing up as a light in Google Assistant/HomeKit.
The main reason for this, is that wall plugs are often used for controlling lights (e.g., your Christmas tree). The current workaround is using a rather nasty light template.
This component provides a more elegant way of doing this and behaves / is similar to the Light Group platform (as in acting on an existing entity). It remains user-friendly and doesn't "fool around" with entity domains.
I'm unsure if a discussion/issue in the architecture repository was needed for this. If so, please let me know.
Python is not my daily used language, and this is my first PR against the Home Assistant repository as well. I'm willing to learn, so if you encounter issues and/or have comments, please consider a little more extensive explanation.
Related issue (if applicable): n/a
Example entry for