Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/logicalDevice.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var async = require('async'),
util = require('util'),
url = require('url');

function LogicalDevice(devices, coordinator) {
function LogicalDevice(devices, coordinator, groupId) {
if (devices.length === 0) {
throw new Error('Logical device must be initialized with at least one device (' + devices.length + ' given)');
}
Expand All @@ -17,6 +17,7 @@ function LogicalDevice(devices, coordinator) {
});

this.devices = sonosDevices;
this.groupId = groupId;
}

util.inherits(LogicalDevice, Sonos);
Expand Down Expand Up @@ -97,7 +98,7 @@ var search = function(callback) {
// initialze all of the logical devices brefore callback
var logicalDevices = Object.keys(groups).map(function(groupId) {
var group = groups[groupId];
return new LogicalDevice(group.members, group.coordinator);
return new LogicalDevice(group.members, group.coordinator, groupId);
});

async.forEach(logicalDevices, function(device) {
Expand Down