From 22a58472854ae03c253c4a2eab204076ee1258f2 Mon Sep 17 00:00:00 2001 From: Yegor Vyalov Date: Thu, 24 Jan 2019 12:26:38 +0200 Subject: [PATCH] Resolves #270 Current light effect for lights --- lib/entity_class/light_entity.class.dart | 1 + lib/entity_widgets/controls/light_controls.dart | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/entity_class/light_entity.class.dart b/lib/entity_class/light_entity.class.dart index 2bcd4b7..8ee19ed 100644 --- a/lib/entity_class/light_entity.class.dart +++ b/lib/entity_class/light_entity.class.dart @@ -33,6 +33,7 @@ class LightEntity extends Entity { LightEntity.SUPPORT_WHITE_VALUE); int get brightness => _getIntAttributeValue("brightness"); + String get effect => attributes["effect"]; int get colorTemp => _getIntAttributeValue("color_temp"); double get maxMireds => _getDoubleAttributeValue("max_mireds"); double get minMireds => _getDoubleAttributeValue("min_mireds"); diff --git a/lib/entity_widgets/controls/light_controls.dart b/lib/entity_widgets/controls/light_controls.dart index 2e0bcdd..23758bf 100644 --- a/lib/entity_widgets/controls/light_controls.dart +++ b/lib/entity_widgets/controls/light_controls.dart @@ -19,7 +19,7 @@ class _LightControlsWidgetState extends State { _tmpBrightness = entity.brightness ?? 0; _tmpColorTemp = entity.colorTemp ?? entity.minMireds?.toInt(); _tmpColor = entity.color ?? _tmpColor; - _tmpEffect = null; + _tmpEffect = entity.effect; } void _setBrightness(LightEntity entity, double value) {