diff --git a/README.md b/README.md index b5b766a7..cb550cd3 100644 --- a/README.md +++ b/README.md @@ -436,6 +436,9 @@ A DeviceInfo object contains general information about a device. It has the foll ## Changelog +#### 0.8.4 (2018-02-23) +* (AlCalzone) Fixed `Group.activateScene` when the scene was already selected + #### 0.8.3 (2018-02-22) * (AlCalzone) Removed the recently-added payload merging because it did more harm than good * (AlCalzone) Fixed `Group.activateScene` when the lights are turned off diff --git a/build/lib/group.js b/build/lib/group.js index 6e76b1f1..2c40511c 100644 --- a/build/lib/group.js +++ b/build/lib/group.js @@ -51,7 +51,11 @@ class Group extends ipsoDevice_1.IPSODevice { activateScene(sceneOrId) { this.ensureLink(); const id = (sceneOrId instanceof scene_1.Scene) ? sceneOrId.instanceId : sceneOrId; - return this.client.operateGroup(this, { + // we need to make sure the scene ID always gets sent, so we cheat a bit + const reference = this.clone(); + reference.sceneId = Number.NaN; + reference.onOff = false; + return this.client.operateGroup(reference, { sceneId: id, onOff: true, }); diff --git a/package.json b/package.json index f0861edf..0d3cb220 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "node-tradfri-client", - "version": "0.8.3", + "version": "0.8.4", "description": "Library to talk to IKEA Trådfri Gateways without external binaries", "keywords": [ "coap", diff --git a/src/lib/group.ts b/src/lib/group.ts index fd3b9ff3..b59d76eb 100644 --- a/src/lib/group.ts +++ b/src/lib/group.ts @@ -78,7 +78,11 @@ export class Group extends IPSODevice { public activateScene(sceneOrId: Scene | number): Promise { this.ensureLink(); const id: number = (sceneOrId instanceof Scene) ? sceneOrId.instanceId : sceneOrId; - return this.client.operateGroup(this, { + // we need to make sure the scene ID always gets sent, so we cheat a bit + const reference = this.clone(); + reference.sceneId = Number.NaN; + reference.onOff = false; + return this.client.operateGroup(reference, { sceneId: id, onOff: true, // this has to be true when changing a scene });