/** * this method is getting called when the device list was changed */ deviceListChanged(_deviceListXML, _lastUpdateId) { var self = this; this.logVerbose("Device list changed"); // parse the xml data into a "usable" js object and store this object at a class instance ParseString(_deviceListXML, function (err, result) { if(!err && result) { self.deviceList = result; // build devices from the given device list (merge new devices into list and remove old ones) self.updateDeviceInstancesFromDeviceList(); self.lastUpdateId = _lastUpdateId; self.emit("deviceListChanged", self.deviceList); } else { self.logError("Error parsing device list result", { "xml": _deviceListXML } ); } }); }
/** * this method is getting called when the zone configuration was changed */ zoneConfigurationChanged(_zoneConfigurationXML, _lastUpdateId) { var self = this; this.logVerbose("Zone configuration changed"); // parse the xml data into a "usable" js object and store this object at a class instance ParseString(_zoneConfigurationXML, function (err, result) { if(!err && result) { self.zoneConfiguration = result; self.updateZoneInformationMap(); self.lastUpdateId = _lastUpdateId; self.logDebug("Zone Configuration changed to: " + JSON.stringify(self.zoneConfiguration)); self.emit("zoneConfigurationChanged", self.zoneConfiguration); } else { self.logError("Error parsing zone configuration result", { "xml": _zoneConfigurationXML } ); } }); }
ParseString(_xmlString, function (_err, _result) { if(!_err && _result)