Skip to content

Commit

Permalink
Ported changes to customerId handling from thorsten-gehrig/alexa-remo…
Browse files Browse the repository at this point in the history
…te-control@f05854f this allow devices accross multiple accounts to work in an Alexa Household
  • Loading branch information
TactfulElf committed Oct 26, 2021
1 parent 4037448 commit 131e04a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions nodes/alexa-remote-routine.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ module.exports = function (RED) {
deviceType: devices[0].deviceType,
deviceSerialNumber: devices[0].serialNumber,
locale: locale,
customerId: devices[0].deviceOwnerCustomerId,
customerId: customerId,
textToSpeak: node.payload.text
}
};
Expand All @@ -123,7 +123,7 @@ module.exports = function (RED) {
type: 'AlexaAnnouncement',
operationPayload: {
expireAfter: 'PT5S',
customerId: devices.length === 0 ? customerId : devices[0].deviceOwnerCustomerId,
customerId: customerId,
content: [{
locale: locale,
display: {
Expand All @@ -136,7 +136,7 @@ module.exports = function (RED) {
}
}],
target: {
customerId: devices.length === 0 ? customerId : devices[0].deviceOwnerCustomerId,
customerId: customerId,
devices: devices.length === 0 ? undefined : devices.map(device => ({
deviceSerialNumber: device.serialNumber,
deviceTypeId: device.deviceType,
Expand Down Expand Up @@ -286,7 +286,7 @@ module.exports = function (RED) {
deviceType: devices[0].deviceType,
deviceSerialNumber: devices[0].serialNumber,
locale: locale,
customerId: devices[0].deviceOwnerCustomerId,
customerId: customerId,
text: node.payload.text
}
};
Expand Down Expand Up @@ -316,7 +316,7 @@ module.exports = function (RED) {
type: 'Alexa.DeviceControls.Stop',
skillId: 'amzn1.ask.1p.alexadevicecontrols',
operationPayload: {
customerId: devices[0].deviceOwnerCustomerId,
customerId: customerId,
devices: devices.map(device => ({
deviceSerialNumber: device.serialNumber,
deviceType: device.deviceType,
Expand All @@ -339,7 +339,7 @@ module.exports = function (RED) {
deviceType: devices[0].deviceType,
deviceSerialNumber: devices[0].serialNumber,
locale: locale,
customerId: devices[0].deviceOwnerCustomerId,
customerId: customerId,
}
};

Expand Down Expand Up @@ -368,7 +368,7 @@ module.exports = function (RED) {
type: 'Alexa.CannedTts.Speak',
skillId: 'amzn1.ask.1p.saysomething',
operationPayload: {
customerId: devices[0].deviceOwnerCustomerId,
customerId: customerId,
deviceType: devices[0].deviceType,
deviceSerialNumber: devices[0].serialNumber,
cannedTtsStringId: `alexa.cannedtts.speak.curatedtts-category-${node.payload.category}/alexa.cannedtts.speak.curatedtts-random`,
Expand Down Expand Up @@ -402,7 +402,7 @@ module.exports = function (RED) {
type: 'Alexa.Sound',
skillId: 'amzn1.ask.1p.sound',
operationPayload: {
customerId: devices[0].deviceOwnerCustomerId,
customerId: customerId,
deviceType: devices[0].deviceType,
deviceSerialNumber: devices[0].serialNumber,
soundStringId: node.payload.sound,
Expand Down Expand Up @@ -477,7 +477,7 @@ module.exports = function (RED) {
deviceType: devices[0].deviceType,
deviceSerialNumber: devices[0].serialNumber,
locale: locale,
customerId: devices[0].deviceOwnerCustomerId,
customerId: customerId,
value: volume,
}
};
Expand Down Expand Up @@ -518,7 +518,7 @@ module.exports = function (RED) {
deviceType: deviceType,
deviceSerialNumber: deviceSerialNumber,
locale: locale,
customerId: device.deviceOwnerCustomerId,
customerId: customerId,
musicProviderId: node.payload.provider,
searchPhrase: searchPhrase,
};
Expand Down Expand Up @@ -634,7 +634,7 @@ module.exports = function (RED) {
skillId: node.payload.skill,
operationPayload: {
locale: locale,
customerId: device.deviceOwnerCustomerId,
customerId: customerId,
targetDevice: {
deviceType: device.deviceType,
deviceSerialNumber: device.serialNumber
Expand Down

0 comments on commit 131e04a

Please sign in to comment.