Device Info (help/opinion)

I’m collecting everything I can from the device in order to be able to call an auxiliary shortcut and have it all at once in a dictionary, instead of having to get each detail one by one.

Question #1: Right now “WiFiOnly” is 0 (false) or 1 (true). Is this clear? Or would it be better to say “Wi-Fi Only” or “Wi-Fi + Cellular”?

Question #2: I can include both IPs, the internal (LAN) and the external one, but I’m not sure it would be of any use. Has anyone used these IPs for something in a shortcut? I don’t want to add them just because I can.

Question #3: If there is no operator (e.g. as in a non-cellular iPad), leave the “Operator” value blank, or say “no” or “none”? I’m not sure if having always some value is any easier to understand.

Regards from Spain,
Antonio

For #1, maybe rename it to “Cellular” and use true/false? Every device has WiFi, so this focuses on the difference: cellular.

For #3, I would suggest using null for “no operator” (rather than a magic English string) because it is easier to detect and feels semantically more correct to me.

Thanks for you input. The problem with true/false is that booleans show as “1” and “0” (although they keep their Boolean type when queried) and I’m not sure their meaning is evident to non-programmers. Also, an “If” action seems not to differentiate between a “1 (Text)”, a “1 (Boolean)” and a “1 (Number)” :grimacing:

Another example: for an “If”, an empty field is equal to: an empty string :+1:, a boolean zero :face_with_raised_eyebrow:, and a arithmethic zero :confounded:

About #1 I’ve decided to copy Apple (when in doubt…:grin:) and use Connectivity as the variable name, and “Wi-Fi” and “Wi-Fi + Cellular” as values (Apple uses this even in their Spanish website :open_mouth:).

I hadn’t consider null. What do you mean with “it is easier to detect”? I’ve just tried to pass a null to an “If” action and its nothing and has no type (as it should). How do you detect it in Shortcuts? :face_with_raised_eyebrow:

Everything you’re saying makes sense and sounds good for this scenario. :slight_smile: My answers were coming more from the point of view of Scriptable (JavaScript) rather than Shortcuts.