sindresorhus/Actions

Action proposal: Get flashlight status

Closed this issue · 4 comments

Description

I control flashlight status with some shortcuts on the action button on my iPhone, but sometimes I want to use context to change the behavior of the button (if the flashlight is on, it should turn it off instead of doing other stuff). Variable tracking the state only works when I don’t use the lock screen or control center buttons for the flashlight - otherwise it gets out of sync.

If I could use a shortcut to get the status (on or off, what percent brightness) that would be incredibly helpful.

Duplicate of #179

I scrolled through to find duplicates, sorry I missed that one.

I'm not an iOS developer, but this item from apple's documentation had me believing it would be possible:

https://developer.apple.com/documentation/avfoundation/avcapturedevice/1624605-torchlevel

There's also an "isTorchActive" item for a pure bool response.

Am I misunderstanding them?

That only returns the torch level / status if the app itself enabled the torch. It will not get the system status of the torch.

Ah, understood. I'm... going to go file a bug report through apple's feedback on that. Doubtful it'll change anything, but that's just stupid.