Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alexa-remote2

Package Overview
Dependencies
Maintainers
2
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alexa-remote2 - npm Package Compare versions

Comparing version 5.7.3 to 5.7.4

26

example/example.js

@@ -9,2 +9,14 @@ let Alexa = require('../alexa-remote');

alexa.on('cookie', (cookie, csrf, macDms) => {
// This event is triggered when a cookie is generated OR refreshed.
// Store these values for subsequent starts
//
// cookie to provide in options.cookie on next start
// csrf belongs to cookie and both needed, but is normally extracted from cookie again on start
// macDms needed for push connections. Provide in options.macDms on next start
// Get alexa.cookieData and store too and provide the content in options.formerRegistrationData on next start to allow cookie refreshs
// You can also just store alexa.cookieData and provide this object as options.cookie, then options.formerRegistrationData is handled internally too
});
alexa.init({

@@ -27,3 +39,3 @@ cookie: cookie, // cookie if already known, else can be generated using proxy

formerDataStorePath: '...', // optional: overwrite path where some of the formerRegistrationData are persisted to optimize against Amazon security measures
formerRegistrationData: { ... }, // optional/preferred: provide the result object from subsequent proxy usages here and some generated data will be reused for next proxy call too
formerRegistrationData: { ... }, // optional/preferred: provide the result object from subsequent proxy usages (cookieData) here and some generated data will be reused for next proxy call too
macDms: { ... }, // required since version 4.0 to use Push connection! Is returned in cookieData.macDms

@@ -36,9 +48,13 @@ },

}
console.log(JSON.stringify(alexa.cookie));
console.log(JSON.stringify(alexa.csrf));
console.log(JSON.stringify(alexa.cookieData));
for (let deviceSerial of Object.keys(alexa.serialNumbers)) {
console.log (deviceSerial);
console.log(deviceSerial);
// const device = alexa.find(deviceSerial); // find device object by serial number
// console.log(JSON.stringify(device, null, 2)); // print device object
// device.sendCommand('volume', 50); // some methods are exposed on device object and can be called without device/deviceSerial
// alexa.sendCommand(device, 'volume', 50); // but can also be called by providing the device object or serial on main class instance
// alexa.sendSequenceCommand(deviceSerial, 'speak', 'Hello friends'); // send sequence command to device
}
}
);

4

package.json
{
"name": "alexa-remote2",
"version": "5.7.3",
"version": "5.7.4",
"description": "Remote Control for amazon echo devices",

@@ -32,3 +32,3 @@ "author": {

"dependencies": {
"alexa-cookie2": "^4.1.1",
"alexa-cookie2": "^4.1.3",
"https": "^1.0.0",

@@ -35,0 +35,0 @@ "querystring": "^0.2.1",

@@ -21,2 +21,15 @@ # alexa-remote2

## Troubleshooting
### Push Connections do not connect
Sometimes it could happen that because of too many connection tries aAmazon blocks the push connection endpoint for a specific IP and "device".
If the Push connection is never established then you can try to use the following:
* delete all cookie, formerRegistrationData and macDms from the settings
* lokale the location of the alexa-cookie2 library in your npm tree
* check if there is a file like .../alexa-cookie2/lib/formerDataStore.json - if existing please delete them
* get new cookie via proxy
Then it should work again
## Known issues/Todos

@@ -27,2 +40,5 @@ * getNotification works, changeNotification not ... maybe change is DELETE +Create :-) (+ source for createNotification: https://github.com/noelportugal/alexa-reminders/blob/master/alexa-reminders.js#L75, and Delete/create: https://github.com/openhab/openhab2-addons/blob/f54c9b85016758ff6d271b62d255bbe41a027928/addons/binding/org.openhab.binding.amazonechocontrol/src/main/java/org/openhab/binding/amazonechocontrol/internal/Connection.java#L829)

## Changelog:
### 5.7.4 (2022-08-03)
* (Apollon77) Update cookie library to optimize cookie handling in other regions like australia
### 5.7.3 (2022-07-19)

@@ -29,0 +45,0 @@ * (Apollon77) Fix deviceStop sequence command

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc