diff --git a/extensions/airpods-noise-control/CHANGELOG.md b/extensions/airpods-noise-control/CHANGELOG.md index 5d7378e9e7bab..0b9c9198c354e 100644 --- a/extensions/airpods-noise-control/CHANGELOG.md +++ b/extensions/airpods-noise-control/CHANGELOG.md @@ -1,5 +1,9 @@ # AirPods Noise Control Changelog +## [Improvements] - 2024-01-03 +- Added `Off` Mode +- Main function fixed + ## [New Additions] - 2023-11-28 - Added adaptive option in noise control diff --git a/extensions/airpods-noise-control/package.json b/extensions/airpods-noise-control/package.json index b538223b4c75c..b0e5c565ab684 100644 --- a/extensions/airpods-noise-control/package.json +++ b/extensions/airpods-noise-control/package.json @@ -2,7 +2,7 @@ "$schema": "https://www.raycast.com/schemas/extension.json", "name": "airpods-noise-control", "title": "AirPods Noise Control", - "description": "Switch between Noise Cancellation, Transparency or Adaptive on your AirPods. Toggle Conversation Awareness on AirPods that support it.", + "description": "Switch between Off, Transparency, Adaptive or Noise Cancellation on your AirPods. Toggle Conversation Awareness on AirPods that support it.", "icon": "extension_icon.png", "author": "chrahe", "contributors": [ @@ -17,8 +17,8 @@ { "name": "index", "title": "Switch Noise Control Mode", - "subtitle": "Transparency ↔ Adaptive ↔ Noise Cancellation", - "description": "This command will switch Noise Cancellation, Transparency or Adaptive if AirPods are connected to your device.", + "subtitle": "Off ↔ Transparency ↔ Adaptive ↔ Noise Cancellation", + "description": "This command will switch Off, Transparency, Adaptive or Noise Cancellation if AirPods are connected to your device.", "mode": "no-view", "keywords": [ "airpods", @@ -30,7 +30,7 @@ "adaptive" ], "preferences": [ - { + { "name": "optionOne", "title": "Option One 🔵", "description": "First option to switch between.", @@ -38,16 +38,20 @@ "default": "Noise Cancellation", "data": [ { - "title": "Noise Cancellation", - "value": "Noise Cancellation" + "title": "Off", + "value": "Off" }, { "title": "Transparency", "value": "Transparency" }, { - "title": "Adaptive", + "title": "Adaptive (only if you have)", "value": "Adaptive" + }, + { + "title": "Noise Cancellation", + "value": "Noise Cancellation" } ], "required": true @@ -60,16 +64,20 @@ "default": "Transparency", "data": [ { - "title": "Noise Cancellation", - "value": "Noise Cancellation" + "title": "Off", + "value": "Off" }, { "title": "Transparency", "value": "Transparency" }, { - "title": "Adaptive", + "title": "Adaptive (only if you have)", "value": "Adaptive" + }, + { + "title": "Noise Cancellation", + "value": "Noise Cancellation" } ], "required": true @@ -142,7 +150,7 @@ "@raycast/utils": "^1.10.1" }, "devDependencies": { - "@raycast/eslint-config": "^1.0.8", + "@raycast/eslint-config": "^1.0.8", "@types/node": "18.8.3", "@types/react": "18.0.9", "eslint": "^8.54.0", @@ -156,4 +164,4 @@ "lint": "ray lint", "publish": "ray publish" } -} +} \ No newline at end of file diff --git a/extensions/airpods-noise-control/src/airpods-menu.ts b/extensions/airpods-noise-control/src/airpods-menu.ts index 99927c14933e2..0d0d0851b8b0a 100644 --- a/extensions/airpods-noise-control/src/airpods-menu.ts +++ b/extensions/airpods-noise-control/src/airpods-menu.ts @@ -9,23 +9,29 @@ export async function execAirPodsMenu( set AirPodsIndex to ${airpodsIndex} set ToggleOption to "${toggleOption}" -on getOptionIndex(Option) - if Option is equal to "Transparency" - set OptionIndex to 2 - else if Option is equal to "Adaptive" +on getOptionIndex(Opt1, Opt2) + if Opt1 is equal to "Off" then + set OptionIndex to 1 + else if Opt1 is equal to "Transparency" then + set OptionIndex to 2 + else if Opt1 is equal to "Adaptive" or Opt2 is equal to "Adaptive" then + if Opt1 is equal to "Adaptive" then set OptionIndex to 3 - else + else if Opt1 is equal to "Noise Cancellation" then set OptionIndex to 4 end if - return OptionIndex + else if Opt1 is equal to "Noise Cancellation" then + set OptionIndex to 3 + end if + return OptionIndex end getOptionIndex if ToggleOption is "noise-control" set OptionOne to "${optionOne}" set OptionTwo to "${optionTwo}" - set IndexOne to AirPodsIndex + getOptionIndex(OptionOne) - set IndexTwo to AirPodsIndex + getOptionIndex(OptionTwo) + set IndexOne to AirPodsIndex + getOptionIndex(OptionOne, OptionTwo) + set IndexTwo to AirPodsIndex + getOptionIndex(OptionTwo, OptionOne) else set OptionOne to "Off" set OptionTwo to "On"