Add some customization options. Fix #11

This commit is contained in:
2019-01-20 21:37:14 +01:00
parent bf9cd55d4c
commit ba8f5049de
2 changed files with 17 additions and 3 deletions

View File

@@ -29,10 +29,10 @@ class SliderEntityRow extends Polymer.Element {
<div class="flex">
<template is="dom-if" if="{{displaySlider}}">
<ha-slider
min="0"
max="100"
min="{{min}}"
max="{{max}}"
value="{{value}}"
step="5"
step="{{step}}"
pin
on-change="selectedValue"
on-click="stopPropagation"
@@ -151,7 +151,12 @@ class SliderEntityRow extends Polymer.Element {
this.displayRow = !config.full_row;
this.displayToggle = config.toggle && domain === 'light';
this.displayValue = !this.displayToggle;
if(config.hide_state) this.displayValue = false;
this.displaySlider = false;
this.min = config.min || 0;
this.max = config.max || 100;
this.step = config.step || 5;
}
statusString(stateObj) {