From 11fc8d1b73f3f05c0439c7ff63ec4722ad24397b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Lov=C3=A9n?= Date: Fri, 17 Aug 2018 15:19:35 +0200 Subject: [PATCH] Only show sliders for dimmable lamps --- slider-entity-row.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/slider-entity-row.js b/slider-entity-row.js index e73f310..99831a5 100644 --- a/slider-entity-row.js +++ b/slider-entity-row.js @@ -62,6 +62,12 @@ class SliderEntityRow extends Polymer.Element { { this.showTop = false; this.showBottom = false; + if(!(this.attribute in this.stateObj.attributes)) { + if(!('supported_features' in this.stateObj.attributes) || + !(this.stateObj.attributes['supported_features'] & 1)) { + return; + } + } if(!(this.hideWhenOff && !this.isOn)) { if(this.breakSlider) this.showBottom = true;