ShareShortcuts

Lumens To Watts

For those of us who are frustrated trying to understand which new light bulbs to buy

brihar73
Fork “Lumens To Watts”

Built something new on top of this Shortcut? Share it as a fork: it becomes a Shortcut of your own, which you manage, and both pages link to each other so brihar73 gets credit.

  1. 1Get the Shortcut and change it in the Shortcuts app. Give it a name of its own.
  2. 2Share it from the Shortcuts app and copy the iCloud link.
  3. 3Come back here, paste the link and describe what is different, e.g. “Added a step that uses Apple Intelligence to personalise the text.”
Downloads
64K
Saved
1
Actions
23
Category
Utilities
Version
1.0
Language
EN

For those of us who are frustrated trying to understand which new light bulbs to buy.

What's New

Version 1.0

First release

Version History
1.0 Nov 18, 2019

First release

What it does

23 actions
  1. Choose from Menu
    Input Type
  2. Choose from Menu
    lumens
  3. Ask for Input
    Value
  4. Set Variable
    lumens
  5. Choose from Menu
    watts (incandescent)
  6. Ask for Input
    Value
  7. Calculate
  8. Set Variable
    lumens
  9. Choose from Menu
    watts (LED)
  10. Ask for Input
    Value
  11. Calculate
  12. Set Variable
    lumens
  13. If
  14. Calculate
  15. Round Number
  16. Set Variable
    watts_inc
  17. Calculate
  18. Round Number
  19. Set Variable
    watts_led
  20. Show Alert
    Results
  21. If
  22. Show Alert
    Results
  23. Stop This Shortcut

View as code
Beta

Every action of this Shortcut written out as Cherri, a programming language for Shortcuts. Great for learning how it works.

#include 'actions/math'
#define color yellow
#define glyph lightbulb


menu "Input Type" {
item "lumens":
	const ProvidedInput = prompt("Value", "Number")
	@lumens = ProvidedInput
item "watts (incandescent)":
	const ProvidedInput = prompt("Value", "Number")
	@lumens = ProvidedInput * 15
item "watts (LED)":
	const ProvidedInput = prompt("Value", "Number")
	@lumens = ProvidedInput * 90
}

if @lumens >= 1 {
	const CalculationResult = @lumens / 15
	ceil(CalculationResult, "Hundredths")
	@watts_inc
	const CalculationResult = @lumens / 90
	ceil(CalculationResult, "Hundredths")
	@watts_led
	alert("Lumens: {@lumens}\nWatts (Incandescent): {@watts_inc}\nWatts (LED): {@watts_led}", "Results")
} else {
	alert("Input number too low.", "Results")
}
stop()
Open in Cherri Playground Decompiled with cherri 2.3.0 (GPL-2.0). May need small fixes before it compiles.

Ratings & Reviews

Write a Review
–
out of 5
★★★★★
★★★★
★★★
★★
★
0 ratings

No reviews yet. Be the first to share what you think!

Advertisement

More by brihar73

See All

You Might Also Like

See All
Advertisement