Skip to content
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

Add extensions to Entity for domain, lights features #2322

Merged
merged 2 commits into from Feb 26, 2022

Conversation

jpelgrom
Copy link
Member

Summary

The Wear OS details panel introduced a new location in the code base where entity properties are used to determine feature support, in addition to phone/'full Android' device controls. To prevent duplicate code or code getting out of sync, especially when more features are supported on Wear OS in the future, and perhaps in more places (widgets?), I propose using extensions to keep the code in one place and make code elsewhere easier to read.

I've added the code to the existing file used for the Entity data class, but maybe another location is better (in the util package, or a new common.data.util package)?

Screenshots

n/a

Link to pull request in Documentation repository

Not needed

Any other notes

 - Add extension property for domain
 - Add extension functions for lights: support for setting brightness and color temperature
@JBassett JBassett merged commit 72a598f into home-assistant:master Feb 26, 2022
@jpelgrom jpelgrom deleted the entity-extensions branch February 26, 2022 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants