From a35cfbfd70807fb4fd3ca4dd9e7a5cda0fd74b62 Mon Sep 17 00:00:00 2001 From: Johan van der Kuijl Date: Fri, 13 Oct 2017 12:13:16 +0200 Subject: [PATCH] Small typo fix (#3602) callack => callback --- source/_docs/ecosystem/appdaemon.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_docs/ecosystem/appdaemon.markdown b/source/_docs/ecosystem/appdaemon.markdown index 1ee291339339..f8f86bdff429 100755 --- a/source/_docs/ecosystem/appdaemon.markdown +++ b/source/_docs/ecosystem/appdaemon.markdown @@ -55,7 +55,7 @@ This is also fairly easy to achieve with Home Assistant automations, but we are ## Motion Light -Our next example is to turn on a light when motion is detected and it is dark, and turn it off after a period of time. This time, the `initialize()` function registers a callback on a state change (of the motion sensor) rather than a specific time. We tell AppDaemon that we are only interested in state changes where the motion detector comes on by adding an additional parameter to the callback registration - `new = "on"`. When the motion is detected, the callack function `motion()` is called, and we check whether or not the sun has set using a built-in convenience function: `sun_down()`. Next, we turn the light on with `turn_on()`, then set a timer using `run_in()` to turn the light off after 60 seconds, which is another call to the scheduler to execute in a set time from now, which results in `AppDaemon` calling `light_off()` 60 seconds later using the `turn_off()` call to actually turn the light off. This is still pretty simple in code terms: +Our next example is to turn on a light when motion is detected and it is dark, and turn it off after a period of time. This time, the `initialize()` function registers a callback on a state change (of the motion sensor) rather than a specific time. We tell AppDaemon that we are only interested in state changes where the motion detector comes on by adding an additional parameter to the callback registration - `new = "on"`. When the motion is detected, the callback function `motion()` is called, and we check whether or not the sun has set using a built-in convenience function: `sun_down()`. Next, we turn the light on with `turn_on()`, then set a timer using `run_in()` to turn the light off after 60 seconds, which is another call to the scheduler to execute in a set time from now, which results in `AppDaemon` calling `light_off()` 60 seconds later using the `turn_off()` call to actually turn the light off. This is still pretty simple in code terms: ```python import homeassistant.appapi as appapi