Allow custom cards and more-info#365
Allow custom cards and more-info#365bramkragten wants to merge 10 commits intohome-assistant:masterfrom bramkragten:patch-2
Conversation
|
@bramkragten, thanks for your PR! By analyzing the history of the files in this pull request, we identified @balloob and @Tommatheussen to be potential reviewers. |
Kept config the same as the state-card for simplicity for the user. Only the height is still [fixed for the domain](https://github.com/home-assistant/home-assistant-polymer/blob/6a864106e0a07452abe148617fa3a0f067b0c526/src/components/ha-cards.html#L84), might need to make that customizable too?
|
Paulus, I think we should drop the requirement in It is very convenient to have a single custom ui element entrypoint, as it can be vulcanized. |
Stupid notepad++
|
I agree, we should drop the |
|
We could override If someone writes a single state card/state-card it's not a problem - they can still create If someone creates a single entrypoint - |
|
The way I made it isn't going to work, because it now also takes the |
|
I don't understand your last comment. If you want separate entry points for similar things - it gets ugly. Paulus, should we have a separate attributes for card/state-cards? In any case let's move away from mandatory file prefixes. |
|
That would make this a breaking-change as of now. Yes, we could use inDialog, but that would mean a user would have to duplicate the normal state-card in the custom-card if he doesn't want to customize the state-card in the more info. Or am I missing something? |
|
I'm fine with the change as it is now, as it still allows to have a single entrypoint. |
|
|
||
| if (unit && domain === 'sensor') { | ||
| if (unit === '°C' || unit === '°F') { | ||
| if (unit === '°C' || unit === '°F') { |
| window.hassUtil.DOMAINS_WITH_MORE_INFO = [ | ||
| 'alarm_control_panel', 'automation', 'camera', 'climate', 'configurator', | ||
| 'cover', 'fan', 'group', 'light', 'lock', 'media_player', 'script', | ||
| 'sun', 'updater', 'vacuum', |
There was a problem hiding this comment.
You removed 'vacuum' here.
|
|
||
| if (window.hassUtil.DOMAINS_WITH_MORE_INFO.indexOf(domain) !== -1) { | ||
| return domain; | ||
| return 'MORE-INFO-' + domain; |
There was a problem hiding this comment.
Since the return value of this function need to be uppercased anyway, I think it is more readable to use lower-case here.
|
There are conflicts because fetching custom ui html is now done separately. |
|
This PR seems to have gone stale. Closing it. You can reopen it when you're ready to finish it. |
Bumps [react](https://github.com/facebook/react/tree/HEAD/packages/react) from 16.13.1 to 16.14.0. - [Release notes](https://github.com/facebook/react/releases) - [Changelog](https://github.com/facebook/react/blob/master/CHANGELOG.md) - [Commits](https://github.com/facebook/react/commits/v16.14.0/packages/react) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Allow custom cards for the domains that have "big" cards.
Same config as a "state" card.