From 62254bb67acd08b048a742e75d37647d5ea6341d Mon Sep 17 00:00:00 2001 From: Jorge Schrauwen Date: Tue, 14 Apr 2020 22:36:22 +0200 Subject: [PATCH] #3352 Apply brightness_percent before others (#3361) As mentioned, simply adding brightness_percent seems to fix the problem. I'll look into doing the reverse if the state is off when I have more time. --- lib/extension/entityPublish.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/extension/entityPublish.js b/lib/extension/entityPublish.js index 0e5d945a..13512ef8 100644 --- a/lib/extension/entityPublish.js +++ b/lib/extension/entityPublish.js @@ -132,7 +132,7 @@ class EntityPublish extends Extension { // Ensure that state and brightness are executed before other commands. const entries = Object.entries(json); - entries.sort((a, b) => (['state', 'brightness'].includes(a[0]) ? -1 : 1)); + entries.sort((a, b) => (['state', 'brightness', 'brightness_percent'].includes(a[0]) ? -1 : 1)); // For each attribute call the corresponding converter const usedConverters = [];