From ae76a2f5f7a3e1ed57e2dcfc370cbe593a283a58 Mon Sep 17 00:00:00 2001 From: Jason Hu Date: Tue, 12 Jun 2018 08:06:14 -0700 Subject: [PATCH] Fix frontend add card / more info page (#24) * Update frontend_add_card.md * Update frontend_add_card.md * Update frontend_add_more_info.md * Update frontend_add_card.md * Update frontend_add_more_info.md * Update frontend_add_card.md --- docs/frontend_add_card.md | 8 ++++---- docs/frontend_add_more_info.md | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/frontend_add_card.md b/docs/frontend_add_card.md index c9ab71c1..997dbd64 100644 --- a/docs/frontend_add_card.md +++ b/docs/frontend_add_card.md @@ -12,10 +12,10 @@ Sensors, when not grouped, are shown as so-called badges on top of the state car ![Badges in the frontend](/img/en/frontend/frontend-badges.png) -The different badges are located in the file [`/src/components/entity/ha-state-label-badge.html`](https://github.com/home-assistant/home-assistant-polymer/blob/master/src/components/entity/ha-state-label-badge.html). +The different badges are located in the file [`/src/components/entity/ha-state-label-badge.js`](https://github.com/home-assistant/home-assistant-polymer/blob/master/src/components/entity/ha-state-label-badge.js). Adding a custom card type can be done with a few simple steps. For this example we will add a new state card for the domain `camera`: - 1. Add `'camera'` to the array `DOMAINS_WITH_CARD` in the file [/util/hass-util.html](https://github.com/home-assistant/home-assistant-polymer/blob/master/src/util/hass-util.html#L11). - 2. Create the files `state-card-camera.html` in the folder [/state-summary/](https://github.com/home-assistant/home-assistant-polymer/tree/master/src/state-summary). - 4. Add `` to [state-card-content.html](https://github.com/home-assistant/home-assistant-polymer/blob/master/src/state-summary/state-card-content.html). + 1. Add `'camera'` to the array `DOMAINS_WITH_CARD` in the file [/common/const.js](https://github.com/home-assistant/home-assistant-polymer/blob/master/src/common/const.js). + 2. Create the files `state-card-camera.js` in the folder [/state-summary/](https://github.com/home-assistant/home-assistant-polymer/tree/master/src/state-summary). + 3. Add `import './state-card-camera.js';` to [state-card-content.js](https://github.com/home-assistant/home-assistant-polymer/blob/master/src/state-summary/state-card-content.js). diff --git a/docs/frontend_add_more_info.md b/docs/frontend_add_more_info.md index 78537918..3902a3a0 100644 --- a/docs/frontend_add_more_info.md +++ b/docs/frontend_add_more_info.md @@ -11,6 +11,6 @@ Whenever the user taps or clicks on one of the cards, a more info dialog will sh The instructions to add a more info dialog are very similar to adding a new card type. This example will add a new more info component for the domain `camera`: - 1. Add `'camera'` to the array `DOMAINS_WITH_MORE_INFO` in the file [util/hass-util.html](https://github.com/home-assistant/home-assistant-polymer/blob/master/src/util/hass-util.html#L24). - 2. Create the files `more-info-camera.html` in the folder [/more-infos](https://github.com/home-assistant/home-assistant-polymer/tree/master/src/more-infos). - 4. Add `` to [more-info-content.html](https://github.com/home-assistant/home-assistant-polymer/blob/master/src/more-infos/more-info-content.html) + 1. Add `'camera'` to the array `DOMAINS_WITH_MORE_INFO` in the file [/common/entity/state_more_info_type.js](https://github.com/home-assistant/home-assistant-polymer/blob/master/src/common/entity/state_more_info_type.js). + 2. Create the files `more-info-camera.js` in the folder [/dialogs/more-info/controls](https://github.com/home-assistant/home-assistant-polymer/tree/master/src/dialogs/more-info/controls). + 3. Add `import './more-info-camera.js';` to [/dialogs/more-info/controls/more-info-content.js](https://github.com/home-assistant/home-assistant-polymer/blob/master/src/dialogs/more-info/controls/more-info-content.js)