Make sure sliderType is set first (#3376)

* Make sure sliderType is set first

* No need for a separate name
This commit is contained in:
Joakim Plate 2019-07-18 00:08:51 +02:00 committed by Paulus Schoutsen
parent 35b38db57f
commit 4cefb9715c

View File

@ -204,13 +204,11 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
!changedProps.has("_jQuery") &&
(!oldHass || oldHass.states[this._config.entity] !== stateObj)
) {
const [sliderValue, uiValue, _sliderType] = this._genSliderValue(
stateObj
);
const [sliderValue, uiValue, sliderType] = this._genSliderValue(stateObj);
this._jQuery("#thermostat", this.shadowRoot).roundSlider({
sliderType,
value: sliderValue,
sliderType: _sliderType,
});
this._updateSetTemp(uiValue);
}
@ -253,14 +251,14 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
this._roundSliderStyle = loaded.roundSliderStyle;
this._jQuery = loaded.jQuery;
const [sliderValue, uiValue, _sliderType] = this._genSliderValue(stateObj);
const [sliderValue, uiValue, sliderType] = this._genSliderValue(stateObj);
this._jQuery("#thermostat", this.shadowRoot).roundSlider({
...thermostatConfig,
radius,
min: stateObj.attributes.min_temp,
max: stateObj.attributes.max_temp,
sliderType: _sliderType,
sliderType,
change: (value) => this._setTemperature(value),
drag: (value) => this._dragEvent(value),
value: sliderValue,