diff --git a/src/components/ha-climate-state.html b/src/components/ha-climate-state.html new file mode 100644 index 0000000000..a42ce41a2a --- /dev/null +++ b/src/components/ha-climate-state.html @@ -0,0 +1,56 @@ + + + + + + + diff --git a/src/state-summary/state-card-climate.html b/src/state-summary/state-card-climate.html index f33498a8ed..252257fff8 100644 --- a/src/state-summary/state-card-climate.html +++ b/src/state-summary/state-card-climate.html @@ -2,6 +2,7 @@ + @@ -13,44 +14,15 @@ line-height: 1.5; } - .state { + ha-climate-state { margin-left: 16px; text-align: right; } - - .target { - color: var(--primary-text-color); - } - - .current { - color: var(--secondary-text-color); - } - - .state-label { - font-weight: bold; - text-transform: capitalize; - }
-
-
- - [[stateObj.state]] - - - [[computeTargetTemperature(stateObj)]] - -
- -
- Currently: - [[stateObj.attributes.current_temperature]] - - [[stateObj.attributes.unit_of_measurement]] -
-
+
@@ -68,22 +40,6 @@ class StateCardClimate extends Polymer.Element { }, }; } - - computeTargetTemperature(stateObj) { - var stateTemp = ''; - - if (stateObj.attributes.target_temp_low && - stateObj.attributes.target_temp_high) { - stateTemp = stateObj.attributes.target_temp_low + ' - ' + - stateObj.attributes.target_temp_high + ' ' + - stateObj.attributes.unit_of_measurement; - } else if (stateObj.attributes.temperature) { - stateTemp = stateObj.attributes.temperature + ' ' + - stateObj.attributes.unit_of_measurement; - } - - return stateTemp; - } } customElements.define(StateCardClimate.is, StateCardClimate);