From 347ef95d3982e34e79c652f961827e7598dd96eb Mon Sep 17 00:00:00 2001 From: Eugenio Panadero Date: Tue, 1 Aug 2017 07:58:03 +0200 Subject: [PATCH] state card for vacuum component with toolbar in more-info-card (#359) * state card for vacuum component with toolbar in more-info-card * Basic functionality: - main switch for turn_on / turn_off. - Show secondary line with optional status, fanspeed and battery status. - Show toolbar with play_plause, stop, locate and return_home service calls in the more-info card. - Use support flags for all extra services (not for turn_on/turn_off). - Filter specific (vacuum) keys in the state attributes table. * lint fix * remove the more-info card, use speed steps with input select - No need for `more-info-vacuum.html` (using `hidden$='{{inDialog}}'` to separate views). - Added an input select for the `vacuum_fanspeed_list` property, to set fanspeeds within the more-info view. This way the controls appear above the history chart, and any extra attribute attached in the platform shows in the normal table below. * change `start_pause` service * remove state-card and add more-info card - No need to make a state-card, as no extra line is allowed in the state-card - No need to add attrs keys to `LOGIC_STATE_ATTRIBUTES`, using the `extra-filters=` parameter. - New more-info card with the vacuum controls and the extra state attrs table. * change state attrs names * one more change state attrs names * fix justification * fix vertical space * fix hide fan_speed when not supported --- src/more-infos/more-info-content.html | 1 + src/more-infos/more-info-vacuum.html | 186 ++++++++++++++++++++++++++ src/util/hass-util.html | 2 +- 3 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 src/more-infos/more-info-vacuum.html diff --git a/src/more-infos/more-info-content.html b/src/more-infos/more-info-content.html index 67da253387..23b3f76c6e 100644 --- a/src/more-infos/more-info-content.html +++ b/src/more-infos/more-info-content.html @@ -15,6 +15,7 @@ + diff --git a/src/util/hass-util.html b/src/util/hass-util.html index 5cac2161f0..e145f7834a 100644 --- a/src/util/hass-util.html +++ b/src/util/hass-util.html @@ -25,7 +25,7 @@ window.hassUtil.DOMAINS_WITH_CARD = [ window.hassUtil.DOMAINS_WITH_MORE_INFO = [ 'alarm_control_panel', 'automation', 'camera', 'climate', 'configurator', 'cover', 'fan', 'group', 'light', 'lock', 'media_player', 'script', - 'sun', 'updater', + 'sun', 'updater', 'vacuum', ]; window.hassUtil.DOMAINS_WITH_NO_HISTORY = ['camera', 'configurator', 'scene'];