From 3541db891d7eb0a536f7d8368f5c90cd50628d7f Mon Sep 17 00:00:00 2001 From: Jorge Schrauwen Date: Fri, 19 Mar 2021 17:48:56 +0100 Subject: [PATCH] groups: also publish color_mode (#6756) --- lib/extension/groups.js | 2 +- test/publish.test.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/extension/groups.js b/lib/extension/groups.js index 3012fd4bc..7b4274548 100644 --- a/lib/extension/groups.js +++ b/lib/extension/groups.js @@ -82,7 +82,7 @@ class Groups extends Extension { return; } - const properties = ['state', 'brightness', 'color_temp', 'color']; + const properties = ['state', 'brightness', 'color_temp', 'color', 'color_mode']; const payload = {}; properties.forEach((prop) => { diff --git a/test/publish.test.js b/test/publish.test.js index 7516c5dc6..b0c1831ac 100644 --- a/test/publish.test.js +++ b/test/publish.test.js @@ -1362,7 +1362,7 @@ describe('Publish', () => { expect(MQTT.publish).toHaveBeenCalledTimes(5); expect(MQTT.publish).toHaveBeenNthCalledWith(1, 'zigbee2mqtt/group_tradfri_remote', - stringify({"brightness":50,"color":{"x":0.408707336668894,"y":0.39239142575868},"color_temp":290,"state":"ON"}), + stringify({"brightness":50,"color":{"x":0.408707336668894,"y":0.39239142575868},"color_temp":290,"state":"ON","color_mode": "color_temp"}), {retain: false, qos: 0}, expect.any(Function) ); expect(MQTT.publish).toHaveBeenNthCalledWith(2, @@ -1372,7 +1372,7 @@ describe('Publish', () => { ); expect(MQTT.publish).toHaveBeenNthCalledWith(3, 'zigbee2mqtt/group_tradfri_remote', - stringify({"brightness":100,"color":{"x":0.408707336668894,"y":0.39239142575868},"color_temp":290,"state":"ON"}), + stringify({"brightness":100,"color":{"x":0.408707336668894,"y":0.39239142575868},"color_temp":290,"state":"ON","color_mode": "color_temp"}), {retain: false, qos: 0}, expect.any(Function) ); expect(MQTT.publish).toHaveBeenNthCalledWith(4,