Nested statement statement IF

Cupertino, January 31, 2021

https://i.imgur.com/M7UqxqQ.jpg https://i.imgur.com/rZY2xfN.jpg So I have this automation for a long press of a button on my nightstand, with a bunch of nested statements if . What are some of your practices for resolving excessive nesting of conditional clauses? The idea behind it is quite simple. -If all the lights are already off -> triggers a good night scene, this ensures that all appliances are turned off and specifically turns off the bedroom TV and plays ambient music -If some lights are still on, you just need to turn off all the lights and other appliances (not the TV in the bedroom), so I can watch it .... before I press the button a second time. Sorry, I didn't find a single answer, so I asked for suggestions here. I'm new to Apples HomeKit and I just moved to the iPhone and the Apple ecosystem.

Best selling & Top trending HomeKit product in our shop at this moment

HomeKit.Blog is in no way affiliated with or endorsed by Apple Inc. or Apple related subsidiaries.

All images, videos and logos are the copyright of the respective rights holders, and this website does not claim ownership or copyright of the aforementioned.

All information about products mentioned on this site has been collected in good faith. However, the information relating to them, may not be 100% accurate, as we only rely on the information we are able to gather from the companies themselves or the resellers who stock these products, and therefore cannot be held responsible for any inaccuracies arising from the aforementioned sources, or any subsequent changes that are made that we have not been made aware of.

HomeKit.Blog Is A Participant In The Amazon Services LLC Associates Program, An Affiliate Advertising Program Designed To Provide A Means For Sites To Earn Advertising Fees By Advertising And Linking To Amazon Store (Amazon.com, Or Endless.com, MYHABIT.com, SmallParts.com, Or AmazonWireless.com).

The opinions expressed on this website by our contributors do not necessarily represent the views of the website owners. 

Copyright © 2022 . All rights reserved
United States