Home Application Breakdown

Learn about the detailed steps required for turning the outdoor lights on from the home application perspective.

The home application

Previously, we discussed the problem of turning the outdoor lights on and how it can be solved. In this lesson, we’ll closely examine the steps required from the home application perspective.

At first, the home application will have absolutely nothing to do, because it will just sit and wait for a signal from the phone app. However, when it gets that signal, it’ll wake up and start to do its work.

When the home application gets the message from the phone, the first thing it needs to do is one of two things. It can either check the local time, or it can contact the sunset service to get the current sunset time. The order of these two operations isn’t essential because we need both, so we can compare them.

When we have the local time and the sunset time, we need to compare them to see if it’s after dark. If it is, all the conditions for turning on the lights are met, and we get a signal that the phone is within range and that it’s dark outside.

Get hands-on with 1200+ tech skills courses.