diff --git a/Intents.swift b/Intents.swift
index 84fc20d..60fa3f5 100644
--- a/Intents.swift
+++ b/Intents.swift
@@ -57,3 +57,57 @@ struct AllOnIntent: AppIntent {
return .result()
}
}
+
+@available(iOS 16.0, *)
+struct AllOffIntent: AppIntent {
+ static let title: LocalizedStringResource = "All Off"
+ static let description = IntentDescription(
+ "Turn off all LEDs",
+ categoryName: "Device"
+ )
+ static let openAppWhenRun: Bool = true
+
+ func perform() async throws -> some IntentResult {
+ if let url = URL(string: "leds://com.ps.TrollLEDs.AllOff") {
+ if await UIApplication.shared.canOpenURL(url) {
+ await UIApplication.shared.open(url)
+ }
+ }
+ return .result()
+ }
+}
+
+@available(iOS 16.0, *)
+struct ManualIntent: AppIntent {
+ static let title: LocalizedStringResource = "Manual"
+ static let description = IntentDescription(
+ "Configure LEDs levels manually (0 - 255) (For Quad-LEDs devices only)",
+ categoryName: "Device"
+ )
+ static let openAppWhenRun: Bool = true
+
+ @Parameter(title: "Cool LED 0", inclusiveRange: (0, 255))
+ var coolLED0: Int
+
+ @Parameter(title: "Cool LED 1", inclusiveRange: (0, 255))
+ var coolLED1: Int
+
+ @Parameter(title: "Warm LED 0", inclusiveRange: (0, 255))
+ var warmLED0: Int
+
+ @Parameter(title: "Warm LED 1", inclusiveRange: (0, 255))
+ var warmLED1: Int
+
+ static var parameterSummary: some ParameterSummary {
+ Summary("Configure LEDs levels to (\(\.$coolLED0), \(\.$coolLED1), \(\.$warmLED0), \(\.$warmLED1))")
+ }
+
+ func perform() async throws -> some IntentResult {
+ if let url = URL(string: "leds://com.ps.TrollLEDs.Manual?coolLED0=\(coolLED0)&coolLED1=\(coolLED1)&warmLED0=\(warmLED0)&warmLED1=\(warmLED1)") {
+ if await UIApplication.shared.canOpenURL(url) {
+ await UIApplication.shared.open(url)
+ }
+ }
+ return .result()
+ }
+}
diff --git a/Makefile b/Makefile
index 8fdee4d..04b5879 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
TARGET := iphone:clang:latest:11.0
INSTALL_TARGET_PROCESSES = TrollLEDs
ARCHS = arm64
-PACKAGE_VERSION = 1.7.0
+PACKAGE_VERSION = 1.8.0
include $(THEOS)/makefiles/common.mk
diff --git a/Resources/Info.plist b/Resources/Info.plist
index 98f57c6..c458c5b 100644
--- a/Resources/Info.plist
+++ b/Resources/Info.plist
@@ -44,9 +44,9 @@
iPhoneOS
CFBundleShortVersionString
- 1.7.0
+ 1.8.0
CFBundleVersion
- 1.7.0
+ 1.8.0
LSRequiresIPhoneOS
MinimumOSVersion
diff --git a/Resources/Metadata.appintents/extract.actionsdata b/Resources/Metadata.appintents/extract.actionsdata
index 8797303..dbfc1b9 100644
--- a/Resources/Metadata.appintents/extract.actionsdata
+++ b/Resources/Metadata.appintents/extract.actionsdata
@@ -1 +1 @@
-{"generator":{"version":"15.2","name":"xcode-tools"},"enums":[],"autoShortcutProviderMangledName":"9TrollLEDs0aB20AppShortcutsProviderV","entities":{},"autoShortcuts":[{"actionIdentifier":"AmberOnIntent","phraseTemplates":[{"key":"Turn on amber LEDs with ${applicationName}"}],"systemImageName":"flashlight.on.circle.fill","shortTitle":{"key":"Amber On"}},{"systemImageName":"flashlight.on.circle.fill","actionIdentifier":"WhiteOnIntent","shortTitle":{"key":"White On"},"phraseTemplates":[{"key":"Turn on white LEDs with ${applicationName}"}]},{"systemImageName":"flashlight.on.circle.fill","shortTitle":{"key":"All On"},"actionIdentifier":"AllOnIntent","phraseTemplates":[{"key":"Turn on all LEDs with ${applicationName}"}]}],"queries":{},"shortcutTileColor":14,"actions":{"AmberOnIntent":{"parameters":[],"presentationStyle":0,"identifier":"AmberOnIntent","outputFlags":0,"systemProtocols":[],"title":{"key":"Amber On"},"openAppWhenRun":true,"isDiscoverable":true,"mangledTypeNameByBundleIdentifier":{},"typeSpecificMetadata":[],"systemProtocolMetadata":[],"availabilityAnnotations":{"LNPlatformNameWildcard":{"introducedVersion":"*"},"LNPlatformNameIOS":{"introducedVersion":"16.0"}},"mangledTypeNameV2":"9TrollLEDs13AmberOnIntentV","mangledTypeName":"9TrollLEDs13AmberOnIntentV","effectiveBundleIdentifiers":[],"authenticationPolicy":0,"descriptionMetadata":{"descriptionText":{"key":"Turn on all amber LEDs"},"searchKeywords":[],"categoryName":{"title":{"key":"Device"}}},"requiredCapabilities":[],"mangledTypeNameByBundleIdentifierV2":{}},"WhiteOnIntent":{"identifier":"WhiteOnIntent","mangledTypeNameByBundleIdentifier":{},"isDiscoverable":true,"mangledTypeName":"9TrollLEDs13WhiteOnIntentV","requiredCapabilities":[],"openAppWhenRun":true,"authenticationPolicy":0,"mangledTypeNameByBundleIdentifierV2":{},"parameters":[],"typeSpecificMetadata":[],"descriptionMetadata":{"descriptionText":{"key":"Turn on all white LEDs"},"categoryName":{"title":{"key":"Device"}},"searchKeywords":[]},"systemProtocols":[],"presentationStyle":0,"outputFlags":0,"availabilityAnnotations":{"LNPlatformNameWildcard":{"introducedVersion":"*"},"LNPlatformNameIOS":{"introducedVersion":"16.0"}},"mangledTypeNameV2":"9TrollLEDs13WhiteOnIntentV","title":{"key":"White On"},"systemProtocolMetadata":[],"effectiveBundleIdentifiers":[]},"AllOnIntent":{"outputFlags":0,"systemProtocolMetadata":[],"availabilityAnnotations":{"LNPlatformNameWildcard":{"introducedVersion":"*"},"LNPlatformNameIOS":{"introducedVersion":"16.0"}},"presentationStyle":0,"isDiscoverable":true,"title":{"key":"All On"},"mangledTypeNameByBundleIdentifier":{},"descriptionMetadata":{"searchKeywords":[],"categoryName":{"title":{"key":"Device"}},"descriptionText":{"key":"Turn on all LEDs"}},"systemProtocols":[],"mangledTypeNameByBundleIdentifierV2":{},"parameters":[],"requiredCapabilities":[],"openAppWhenRun":true,"effectiveBundleIdentifiers":[],"authenticationPolicy":0,"mangledTypeName":"9TrollLEDs11AllOnIntentV","typeSpecificMetadata":[],"mangledTypeNameV2":"9TrollLEDs11AllOnIntentV","identifier":"AllOnIntent"}},"negativePhrases":[],"version":1}
\ No newline at end of file
+{"autoShortcuts":[{"actionIdentifier":"AmberOnIntent","shortTitle":{"key":"Amber On"},"phraseTemplates":[{"key":"Turn on amber LEDs with ${applicationName}"}],"systemImageName":"flashlight.on.circle.fill"},{"shortTitle":{"key":"White On"},"phraseTemplates":[{"key":"Turn on white LEDs with ${applicationName}"}],"actionIdentifier":"WhiteOnIntent","systemImageName":"flashlight.on.circle.fill"},{"actionIdentifier":"AllOnIntent","phraseTemplates":[{"key":"Turn on all LEDs with ${applicationName}"}],"shortTitle":{"key":"All On"},"systemImageName":"flashlight.on.circle.fill"},{"shortTitle":{"key":"All Off"},"systemImageName":"flashlight.off.circle.fill","phraseTemplates":[{"key":"Turn off all LEDs with ${applicationName}"}],"actionIdentifier":"AllOffIntent"},{"shortTitle":{"key":"Manual"},"systemImageName":"flashlight.on.circle.fill","actionIdentifier":"ManualIntent","phraseTemplates":[{"key":"Configure LEDs levels manually with ${applicationName}"}]}],"queries":{},"negativePhrases":[],"actions":{"ManualIntent":{"title":{"key":"Manual"},"parameters":[{"isOptional":false,"title":{"key":"Cool LED 0"},"dynamicOptionsSupport":0,"typeSpecificMetadata":["LNValueTypeMetadataKeyNumberRangeType",{"int":{"wrapper":0}},"LNValueTypeMetadataKeyNumberUpperBound",{"double":{"wrapper":255}},"LNValueTypeMetadataKeyNumberLowerBound",{"double":{"wrapper":0}}],"valueType":{"primitive":{"wrapper":{"typeIdentifier":2}}},"name":"coolLED0","inputConnectionBehavior":0,"resolvableInputTypes":[{"kindValue":0,"valueType":{"primitive":{"wrapper":{"typeIdentifier":2}}}},{"valueType":{"primitive":{"wrapper":{"typeIdentifier":7}}},"kindValue":0},{"kindValue":0,"valueType":{"primitive":{"wrapper":{"typeIdentifier":0}}}}],"isInput":false},{"valueType":{"primitive":{"wrapper":{"typeIdentifier":2}}},"dynamicOptionsSupport":0,"resolvableInputTypes":[{"valueType":{"primitive":{"wrapper":{"typeIdentifier":2}}},"kindValue":0},{"valueType":{"primitive":{"wrapper":{"typeIdentifier":7}}},"kindValue":0},{"kindValue":0,"valueType":{"primitive":{"wrapper":{"typeIdentifier":0}}}}],"title":{"key":"Cool LED 1"},"name":"coolLED1","typeSpecificMetadata":["LNValueTypeMetadataKeyNumberLowerBound",{"double":{"wrapper":0}},"LNValueTypeMetadataKeyNumberRangeType",{"int":{"wrapper":0}},"LNValueTypeMetadataKeyNumberUpperBound",{"double":{"wrapper":255}}],"isInput":false,"inputConnectionBehavior":0,"isOptional":false},{"isInput":false,"dynamicOptionsSupport":0,"title":{"key":"Warm LED 0"},"inputConnectionBehavior":0,"name":"warmLED0","isOptional":false,"valueType":{"primitive":{"wrapper":{"typeIdentifier":2}}},"resolvableInputTypes":[{"kindValue":0,"valueType":{"primitive":{"wrapper":{"typeIdentifier":2}}}},{"valueType":{"primitive":{"wrapper":{"typeIdentifier":7}}},"kindValue":0},{"kindValue":0,"valueType":{"primitive":{"wrapper":{"typeIdentifier":0}}}}],"typeSpecificMetadata":["LNValueTypeMetadataKeyNumberRangeType",{"int":{"wrapper":0}},"LNValueTypeMetadataKeyNumberLowerBound",{"double":{"wrapper":0}},"LNValueTypeMetadataKeyNumberUpperBound",{"double":{"wrapper":255}}]},{"isOptional":false,"isInput":false,"typeSpecificMetadata":["LNValueTypeMetadataKeyNumberUpperBound",{"double":{"wrapper":255}},"LNValueTypeMetadataKeyNumberLowerBound",{"double":{"wrapper":0}},"LNValueTypeMetadataKeyNumberRangeType",{"int":{"wrapper":0}}],"resolvableInputTypes":[{"valueType":{"primitive":{"wrapper":{"typeIdentifier":2}}},"kindValue":0},{"valueType":{"primitive":{"wrapper":{"typeIdentifier":7}}},"kindValue":0},{"kindValue":0,"valueType":{"primitive":{"wrapper":{"typeIdentifier":0}}}}],"title":{"key":"Warm LED 1"},"valueType":{"primitive":{"wrapper":{"typeIdentifier":2}}},"name":"warmLED1","inputConnectionBehavior":0,"dynamicOptionsSupport":0}],"openAppWhenRun":true,"isDiscoverable":true,"authenticationPolicy":0,"effectiveBundleIdentifiers":[],"outputFlags":0,"systemProtocols":[],"descriptionMetadata":{"searchKeywords":[],"categoryName":{"title":{"key":"Device"}},"descriptionText":{"key":"Configure LEDs levels manually (0 - 255) (For Quad-LEDs devices only)"}},"mangledTypeNameByBundleIdentifier":{},"systemProtocolMetadata":[],"typeSpecificMetadata":[],"mangledTypeNameV2":"9TrollLEDs12ManualIntentV","mangledTypeNameByBundleIdentifierV2":{},"availabilityAnnotations":{"LNPlatformNameIOS":{"introducedVersion":"16.0"},"LNPlatformNameWildcard":{"introducedVersion":"*"}},"requiredCapabilities":[],"actionConfiguration":{"actionSummary":{"wrapper":{"summaryString":{"parameterIdentifiers":["coolLED0","coolLED1","warmLED0","warmLED1"],"formatString":"Configure LEDs levels to (${coolLED0}, ${coolLED1}, ${warmLED0}, ${warmLED1})"},"otherParameterIdentifiers":[]}}},"mangledTypeName":"9TrollLEDs12ManualIntentV","presentationStyle":0,"identifier":"ManualIntent"},"AllOnIntent":{"requiredCapabilities":[],"systemProtocols":[],"systemProtocolMetadata":[],"openAppWhenRun":true,"descriptionMetadata":{"descriptionText":{"key":"Turn on all LEDs"},"categoryName":{"title":{"key":"Device"}},"searchKeywords":[]},"identifier":"AllOnIntent","parameters":[],"outputFlags":0,"typeSpecificMetadata":[],"mangledTypeNameByBundleIdentifier":{},"presentationStyle":0,"authenticationPolicy":0,"title":{"key":"All On"},"isDiscoverable":true,"effectiveBundleIdentifiers":[],"mangledTypeName":"9TrollLEDs11AllOnIntentV","availabilityAnnotations":{"LNPlatformNameWildcard":{"introducedVersion":"*"},"LNPlatformNameIOS":{"introducedVersion":"16.0"}},"mangledTypeNameV2":"9TrollLEDs11AllOnIntentV","mangledTypeNameByBundleIdentifierV2":{}},"AmberOnIntent":{"parameters":[],"availabilityAnnotations":{"LNPlatformNameIOS":{"introducedVersion":"16.0"},"LNPlatformNameWildcard":{"introducedVersion":"*"}},"mangledTypeNameByBundleIdentifier":{},"authenticationPolicy":0,"openAppWhenRun":true,"descriptionMetadata":{"categoryName":{"title":{"key":"Device"}},"descriptionText":{"key":"Turn on all amber LEDs"},"searchKeywords":[]},"mangledTypeNameV2":"9TrollLEDs13AmberOnIntentV","effectiveBundleIdentifiers":[],"systemProtocolMetadata":[],"typeSpecificMetadata":[],"presentationStyle":0,"identifier":"AmberOnIntent","requiredCapabilities":[],"mangledTypeNameByBundleIdentifierV2":{},"systemProtocols":[],"mangledTypeName":"9TrollLEDs13AmberOnIntentV","isDiscoverable":true,"title":{"key":"Amber On"},"outputFlags":0},"AllOffIntent":{"requiredCapabilities":[],"effectiveBundleIdentifiers":[],"parameters":[],"systemProtocolMetadata":[],"mangledTypeName":"9TrollLEDs12AllOffIntentV","identifier":"AllOffIntent","title":{"key":"All Off"},"presentationStyle":0,"descriptionMetadata":{"searchKeywords":[],"descriptionText":{"key":"Turn off all LEDs"},"categoryName":{"title":{"key":"Device"}}},"isDiscoverable":true,"systemProtocols":[],"outputFlags":0,"mangledTypeNameByBundleIdentifierV2":{},"openAppWhenRun":true,"typeSpecificMetadata":[],"authenticationPolicy":0,"mangledTypeNameV2":"9TrollLEDs12AllOffIntentV","mangledTypeNameByBundleIdentifier":{},"availabilityAnnotations":{"LNPlatformNameWildcard":{"introducedVersion":"*"},"LNPlatformNameIOS":{"introducedVersion":"16.0"}}},"WhiteOnIntent":{"mangledTypeName":"9TrollLEDs13WhiteOnIntentV","parameters":[],"effectiveBundleIdentifiers":[],"mangledTypeNameByBundleIdentifierV2":{},"systemProtocols":[],"isDiscoverable":true,"typeSpecificMetadata":[],"availabilityAnnotations":{"LNPlatformNameWildcard":{"introducedVersion":"*"},"LNPlatformNameIOS":{"introducedVersion":"16.0"}},"authenticationPolicy":0,"presentationStyle":0,"mangledTypeNameV2":"9TrollLEDs13WhiteOnIntentV","title":{"key":"White On"},"requiredCapabilities":[],"descriptionMetadata":{"categoryName":{"title":{"key":"Device"}},"searchKeywords":[],"descriptionText":{"key":"Turn on all white LEDs"}},"mangledTypeNameByBundleIdentifier":{},"outputFlags":0,"identifier":"WhiteOnIntent","openAppWhenRun":true,"systemProtocolMetadata":[]}},"entities":{},"enums":[],"autoShortcutProviderMangledName":"9TrollLEDs0aB20AppShortcutsProviderV","shortcutTileColor":14,"generator":{"name":"xcode-tools","version":"15.2"},"version":1}
\ No newline at end of file
diff --git a/Resources/Metadata.appintents/nlu/en_US.3b3c1ac8ff7d03aa7cc04f67ceedb451.version b/Resources/Metadata.appintents/nlu/en_US.3b3c1ac8ff7d03aa7cc04f67ceedb451.version
deleted file mode 100644
index f76dd23..0000000
Binary files a/Resources/Metadata.appintents/nlu/en_US.3b3c1ac8ff7d03aa7cc04f67ceedb451.version and /dev/null differ
diff --git a/Resources/Metadata.appintents/nlu/en_US.nlu.lzfse b/Resources/Metadata.appintents/nlu/en_US.nlu.lzfse
deleted file mode 100644
index c3f8cb1..0000000
Binary files a/Resources/Metadata.appintents/nlu/en_US.nlu.lzfse and /dev/null differ
diff --git a/Resources/Metadata.appintents/root.ssu.yaml b/Resources/Metadata.appintents/root.ssu.yaml
deleted file mode 100644
index 91dfb5e..0000000
--- a/Resources/Metadata.appintents/root.ssu.yaml
+++ /dev/null
@@ -1,55 +0,0 @@
-apiVersion: ssu/v1
-nlu:
- shortcuts:
- bundleIdentifier: com.ps.TrollLEDs
- intents:
- - metadata:
- name: AmberOnIntent_0
- title: Amber On
- corpuses:
- training:
- - locale: en_US
- utterances:
- - Turn on amber LEDs with ${+applicationName}
- - metadata:
- name: WhiteOnIntent_1
- title: White On
- corpuses:
- training:
- - locale: en_US
- utterances:
- - Turn on white LEDs with ${+applicationName}
- - metadata:
- name: AllOnIntent_2
- title: All On
- corpuses:
- training:
- - locale: en_US
- utterances:
- - Turn on all LEDs with ${+applicationName}
- - metadata:
- name: +negative
- corpuses:
- training:
- - locale: en_US
- utterances:
- - ${+standardAppShortcutNegatives}
-variables:
-- name: +applicationName
- type: ssu/expansion
- definitions:
- - locale: en_US
- synomyms:
- - TrollLEDs
-- name: +prefix
- type: ssu/expansion
- definitions:
- - locale: en_US
- synomyms:
- $ref: ssu://Resources/prefix/en.yaml
-- name: +standardAppShortcutNegatives
- type: ssu/expansion
- definitions:
- - locale: en_US
- synomyms:
- $ref: ssu://Resources/standardAppShortcutNegatives/en.yaml
diff --git a/ShortcutsProvider.swift b/ShortcutsProvider.swift
index 5e84efb..1c25034 100644
--- a/ShortcutsProvider.swift
+++ b/ShortcutsProvider.swift
@@ -27,5 +27,21 @@ struct TrollLEDsAppShortcutsProvider: AppShortcutsProvider {
shortTitle: "All On",
systemImageName: "flashlight.on.circle.fill"
)
+ AppShortcut(
+ intent: AllOffIntent(),
+ phrases: [
+ "Turn off all LEDs with \(.applicationName)"
+ ],
+ shortTitle: "All Off",
+ systemImageName: "flashlight.off.circle.fill"
+ )
+ AppShortcut(
+ intent: ManualIntent(),
+ phrases: [
+ "Configure LEDs levels manually with \(.applicationName)"
+ ],
+ shortTitle: "Manual",
+ systemImageName: "flashlight.on.circle.fill"
+ )
}
}
diff --git a/TLAppDelegate.m b/TLAppDelegate.m
index 36490eb..5402391 100644
--- a/TLAppDelegate.m
+++ b/TLAppDelegate.m
@@ -23,7 +23,7 @@ - (UISceneConfiguration *)application:(UIApplication *)application configuration
}
- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded))completionHandler {
- [_myViewController handleShortcutAction:shortcutItem.type];
+ [_myViewController handleShortcutAction:shortcutItem.type withParameters:nil];
}
- (void)appWillEnterForeground:(UIApplication *)application {
@@ -45,8 +45,10 @@ - (BOOL)application:(UIApplication *)app openURL:(NSURL *)url options:(NSDiction
if (!url) return NO;
if ([url.scheme isEqualToString:@"leds"]) {
NSString *action = url.host;
- if (action)
- [_myViewController handleShortcutAction:action];
+ if (action) {
+ NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
+ [_myViewController handleShortcutAction:action withParameters:components.queryItems];
+ }
}
return YES;
}
diff --git a/TLRootViewController.h b/TLRootViewController.h
index c4b6a4b..ba399b1 100644
--- a/TLRootViewController.h
+++ b/TLRootViewController.h
@@ -5,7 +5,7 @@
TLDeviceManager *deviceManager;
}
@property (nonatomic, retain) NSString *shortcutAction;
-- (void)handleShortcutAction:(NSString *)action;
+- (void)handleShortcutAction:(NSString *)action withParameters:(NSArray *)params;
- (void)setupStream;
- (void)releaseStream;
@end
diff --git a/TLRootViewController.m b/TLRootViewController.m
index 0680d99..5ed134c 100644
--- a/TLRootViewController.m
+++ b/TLRootViewController.m
@@ -74,7 +74,7 @@ - (BOOL)isQuadLEDs {
return [[NSUserDefaults standardUserDefaults] boolForKey:@"TLQuadLEDs"];
}
-- (void)handleShortcutAction:(NSString *)shortcutType {
+- (void)handleShortcutAction:(NSString *)shortcutType withParameters:(NSArray *)parameters {
BOOL legacy = [_deviceManager isLegacyLEDs];
BOOL quad = [self isQuadLEDs];
if ([shortcutType isEqualToString:@"com.ps.TrollLEDs.AmberOn"]) {
@@ -98,12 +98,36 @@ - (void)handleShortcutAction:(NSString *)shortcutType {
WarmLED1Level = 0;
}
} else if ([shortcutType isEqualToString:@"com.ps.TrollLEDs.AllOn"]) {
- if (!legacy) {
+ if (legacy) {
+ LEDLevel = 100;
+ } else {
CoolLED0Level = 255;
CoolLED1Level = quad ? 255 : 0;
WarmLED0Level = 255;
WarmLED1Level = quad ? 255 : 0;
}
+ } else if ([shortcutType isEqualToString:@"com.ps.TrollLEDs.AllOff"]) {
+ if (legacy) {
+ LEDLevel = 0;
+ } else {
+ CoolLED0Level = 0;
+ CoolLED1Level = 0;
+ WarmLED0Level = 0;
+ WarmLED1Level = 0;
+ }
+ } else if ([shortcutType isEqualToString:@"com.ps.TrollLEDs.Manual"]) {
+ if (!legacy) {
+ for (NSURLQueryItem *parameter in parameters) {
+ if ([parameter.name isEqualToString:@"coolLED0"])
+ CoolLED0Level = [parameter.value intValue];
+ else if ([parameter.name isEqualToString:@"coolLED1"])
+ CoolLED1Level = [parameter.value intValue];
+ else if ([parameter.name isEqualToString:@"warmLED0"])
+ WarmLED0Level = [parameter.value intValue];
+ else if ([parameter.name isEqualToString:@"warmLED1"])
+ WarmLED1Level = [parameter.value intValue];
+ }
+ }
}
if (legacy) {
_sliders[0].value = LEDLevel;
@@ -290,7 +314,7 @@ - (void)viewDidLoad {
[self configureLEDSliders:sliderCount maximumValue:isLegacyLEDs ? 100 : 255];
if (_shortcutAction) {
- [self handleShortcutAction:_shortcutAction];
+ [self handleShortcutAction:_shortcutAction withParameters:nil];
_shortcutAction = nil;
}
}
diff --git a/TLSceneDelegate.m b/TLSceneDelegate.m
index 9968443..ff202f8 100644
--- a/TLSceneDelegate.m
+++ b/TLSceneDelegate.m
@@ -15,7 +15,7 @@ - (void)scene:(UIScene *)scene willConnectToSession:(UISceneSession *)session op
}
- (void)windowScene:(UIWindowScene *)windowScene performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded))completionHandler API_AVAILABLE(ios(13.0)) {
- [_myViewController handleShortcutAction:shortcutItem.type];
+ [_myViewController handleShortcutAction:shortcutItem.type withParameters:nil];
completionHandler(YES);
}
@@ -41,8 +41,10 @@ - (void)scene:(UIScene *)scene openURLContexts:(NSSet *)URL
if (!url) continue;
if ([url.scheme isEqualToString:@"leds"]) {
NSString *action = url.host;
- if (action)
- [_myViewController handleShortcutAction:action];
+ if (action) {
+ NSURLComponents *components = [NSURLComponents componentsWithURL:url resolvingAgainstBaseURL:NO];
+ [_myViewController handleShortcutAction:action withParameters:components.queryItems];
+ }
}
}
}