From 4bc83b01d3971d50f134b741bb33272a61d8dcad Mon Sep 17 00:00:00 2001 From: Jerad Meisner Date: Mon, 13 Aug 2018 00:42:09 -0700 Subject: [PATCH] Remove _hiddenState method. (#1557) * Remove _hiddenState method since it always has the same result. * Hide state when row element is narrow. Add input_number row to gallery. --- gallery/src/demos/demo-hui-entities-card.js | 13 +++++++++++++ .../entity-rows/hui-input-number-entity-row.js | 15 ++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/gallery/src/demos/demo-hui-entities-card.js b/gallery/src/demos/demo-hui-entities-card.js index 1c53859965..d79e8ba05c 100644 --- a/gallery/src/demos/demo-hui-entities-card.js +++ b/gallery/src/demos/demo-hui-entities-card.js @@ -55,6 +55,15 @@ const ENTITIES = [ unit_of_measurement: '°F', friendly_name: 'Ecobee', supported_features: 1014 + }), + getEntity('input_number', 'noise_allowance', 5, { + min: 0, + max: 10, + step: 1, + mode: 'slider', + unit_of_measurement: 'dB', + friendly_name: 'Allowed Noise', + icon: 'mdi:bell-ring' }) ]; @@ -72,6 +81,7 @@ const CONFIGS = [ - light.bed_light - light.non_existing - climate.ecobee + - input_number.noise_allowance ` }, { @@ -86,6 +96,7 @@ const CONFIGS = [ - lock.kitchen_door - light.bed_light - climate.ecobee + - input_number.noise_allowance title: Random group ` }, @@ -101,6 +112,7 @@ const CONFIGS = [ - lock.kitchen_door - light.bed_light - climate.ecobee + - input_number.noise_allowance title: Random group show_header_toggle: false ` @@ -130,6 +142,7 @@ const CONFIGS = [ - lock.kitchen_door - light.bed_light - climate.ecobee + - input_number.noise_allowance title: Random group show_header_toggle: false ` diff --git a/src/panels/lovelace/entity-rows/hui-input-number-entity-row.js b/src/panels/lovelace/entity-rows/hui-input-number-entity-row.js index 9788c034f7..0aef748f0f 100644 --- a/src/panels/lovelace/entity-rows/hui-input-number-entity-row.js +++ b/src/panels/lovelace/entity-rows/hui-input-number-entity-row.js @@ -40,7 +40,7 @@ class HuiInputNumberEntityRow extends mixinBehaviors([IronResizableBehavior], Po on-change="_selectedValueChanged" ignore-bar-touch > -
[[_value]] [[_stateObj.attributes.unit_of_measurement]]
+ [[_value]] [[_stateObj.attributes.unit_of_measurement]]