Forked from nbogojevic/remove_home_assistant_alexa.js
Created
November 27, 2023 16:08
-
-
Save sunnydsouza/f1819f9c0cbdcfd571a66405ccd85ad6 to your computer and use it in GitHub Desktop.
Remove all Home Assistant devices from Alexa
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Paste in development console | |
$x('//div[contains(text(), "Home Assistant")]') | |
.map((innerDiv) => innerDiv.parentNode.parentNode) | |
.map((parentDiv) => parentDiv.getElementsByTagName("button")[0]) | |
.forEach((button) => { | |
fetch( | |
`https://alexa.amazon.fr/api/phoenix/appliance/${encodeURIComponent(button.getAttribute( | |
"appliance-id" | |
))}`, | |
{ | |
method: "DELETE", | |
} | |
); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment